forked from aws-powertools/powertools-lambda-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtransfer_family.py
More file actions
32 lines (29 loc) · 1.14 KB
/
Copy pathtransfer_family.py
File metadata and controls
32 lines (29 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from typing import Literal, Optional
from pydantic import BaseModel, Field
from pydantic.networks import IPvAnyAddress
class TransferFamilyAuthorizer(BaseModel):
username: str = Field(
description="The username of the user attempting to authenticate.",
examples=["bobusa", "john.doe", "sftp-user-123", "data-transfer-user"],
)
password: Optional[str] = Field(
default=None,
description="The password for authentication.",
examples=["<password>", "<user-password>", None],
)
protocol: Literal["SFTP", "FTP", "FTPS"] = Field(
description="The protocol used for the connection.",
examples=["SFTP", "FTPS", "FTP"],
)
server_id: str = Field(
...,
alias="serverId",
description="The server ID of the Transfer Family server.",
examples=["s-abcd123456", "s-1234567890abcdef0", "s-example123"],
)
source_ip: IPvAnyAddress = Field(
...,
alias="sourceIp",
description="The IP address of the client connecting to the Transfer Family server.",
examples=["192.168.0.100", "10.0.0.50", "127.0.0.1", "203.0.113.12"],
)