Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions types/aws-lambda/test/transfer-family-authorizer-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,14 @@ const getPathBasedDirectoryResponse = (event: TransferFamilyAuthorizerEvent): Tr

return response;
};

/**
* Example that constructs test event for an undefined password for key based auth
*/
const testEvent: TransferFamilyAuthorizerEvent = {
username: "testinguser",
protocol: "SFTP",
serverId: "10.10.10.10.10",
sourceIp: "0.0.0.0.0",
};
const getPathBasedDirectoryResponseResult = getPathBasedDirectoryResponse(testEvent);
3 changes: 2 additions & 1 deletion types/aws-lambda/trigger/transfer-family-authorizer.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ export type TransferFamilyAuthorizerHandler = Handler<TransferFamilyAuthorizerEv
/**
* Transfer Family Authorizer Event. This is the event that will be passed to the Lambda function.
* Event message structure can be found here: https://docs.aws.amazon.com/transfer/latest/userguide/custom-lambda-idp.html
* While the documentation is not explicit, for key based auth, password will be undefined
*/
export interface TransferFamilyAuthorizerEvent {
username: string;
password: string;
password?: string;
protocol: "SFTP" | "FTP" | "FTPS";
serverId: string;
sourceIp: string;
Expand Down