Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Add AWS Transfer Family event source data class #5904

Open
1 of 2 tasks
leandrodamascena opened this issue Jan 23, 2025 · 0 comments · May be fixed by #5912
Open
1 of 2 tasks

Feature request: Add AWS Transfer Family event source data class #5904

leandrodamascena opened this issue Jan 23, 2025 · 0 comments · May be fixed by #5912
Assignees
Labels
event_sources Event Source Data Class utility feature-request feature request

Comments

@leandrodamascena
Copy link
Contributor

Use case

I'm working on a project that integrates AWS Transfer Family with Custom Identity Providers like: Auth0, Okta and others. To make this possible, you should have a Lambda in the middle that will receive the event from Transfer Family and then you do whatever logic you need to authenticate or not the client.

Payload

The payload looks like this, the only thing special about this payload is because the password cannot be sent if the user is authenticating using public keys, so, must make it optional.

{
    "username": "value",
    "password": "value",
    "protocol": "SFTP",
    "serverId": "s-abcd123456",
    "sourceIp": "192.168.0.100"
}

Response

In order to authenticate the customer or not, the Lambda must reply a json like this:

{
   "Role":"arn:aws:iam::123456789012:role/example-role",
   "PosixProfile":{
      "Gid":1000,
      "Uid":5000
   },
   "HomeDirectoryDetails":[
      {
         "Entry":"/home/jsmith",
         "Target":"/efs/users/jsmith"
      }
   ],
   "HomeDirectoryType":"LOGICAL"
}

This feature request must create a factory to facilitate the response of this authentication.

Solution/User Experience

from aws_lambda_powertools.utilities.data_classes import event_source, AWSTransferFamily

@event_source(data_class=AWSTransferFamily)
def lambda_handler(event: AWSTransferFamily, context):
    if event.username == 'blablabla' and event.password == 'valid':
      return event.build_response(role='', gid=''....)

Alternative solutions

Acknowledgment

@leandrodamascena leandrodamascena added feature-request feature request triage Pending triage from maintainers labels Jan 23, 2025
@leandrodamascena leandrodamascena linked a pull request Jan 23, 2025 that will close this issue
7 tasks
@leandrodamascena leandrodamascena linked a pull request Jan 23, 2025 that will close this issue
7 tasks
@leandrodamascena leandrodamascena removed the triage Pending triage from maintainers label Jan 23, 2025
@leandrodamascena leandrodamascena self-assigned this Jan 23, 2025
@leandrodamascena leandrodamascena moved this from Triage to Working on it in Powertools for AWS Lambda (Python) Jan 23, 2025
@leandrodamascena leandrodamascena added the event_sources Event Source Data Class utility label Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
event_sources Event Source Data Class utility feature-request feature request
Projects
Status: Working on it
Development

Successfully merging a pull request may close this issue.

1 participant