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
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
namespace Amazon.Lambda.APIGatewayEvents
{
using System.Collections.Generic;
using System.Runtime.Serialization;

/// <summary>
/// An object representing the expected format of an API Gateway authorization response.
/// https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html
/// </summary>
[DataContract]
public class APIGatewayCustomAuthorizerV2IamResponse
{
/// <summary>
/// Gets or sets the ID of the principal.
/// </summary>
[DataMember(Name = "principalId")]
#if NETCOREAPP_3_1
[System.Text.Json.Serialization.JsonPropertyName("principalId")]
#endif
public string PrincipalID { get; set; }

/// <summary>
/// Gets or sets the <see cref="APIGatewayCustomAuthorizerPolicy"/> policy document.
/// </summary>
[DataMember(Name = "policyDocument")]
#if NETCOREAPP_3_1
[System.Text.Json.Serialization.JsonPropertyName("policyDocument")]
#endif
public APIGatewayCustomAuthorizerPolicy PolicyDocument { get; set; } = new APIGatewayCustomAuthorizerPolicy();

/// <summary>
/// Gets or sets the <see cref="APIGatewayCustomAuthorizerContext"/> property.
/// </summary>
[DataMember(Name = "context")]
#if NETCOREAPP_3_1
[System.Text.Json.Serialization.JsonPropertyName("context")]
#endif
public Dictionary<string, object> Context { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
using System.Collections.Generic;

namespace Amazon.Lambda.APIGatewayEvents
{
/// <summary>
/// For requests coming in to a custom API Gateway authorizer function.
/// https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html
/// </summary>
public class APIGatewayCustomAuthorizerV2Request
{
/// <summary>
/// Gets or sets the 'type' property.
/// </summary>
public string Type { get; set; }

/// <summary>
/// Gets or sets the 'routeArn' property.
/// </summary>
public string RouteArn { get; set; }

/// <summary>
/// List of identity sources for the request.
/// </summary>
public List<string> IdentitySource { get; set; }

/// <summary>
/// Gets or sets the 'routeKey' property.
/// </summary>
public string RouteKey { get; set; }

/// <summary>
/// Raw url path for the caller.
/// </summary>
public string RawPath { get; set; }

/// <summary>
/// Raw query string for the caller.
/// </summary>
public string RawQueryString { get; set; }

/// <summary>
/// The cookies sent with the request.
/// </summary>
public List<string> Cookies { get; set; }

/// <summary>
/// The headers sent with the request.
/// </summary>
public Dictionary<string, string> Headers { get; set; }

/// <summary>
/// The query string parameters that were part of the request.
/// </summary>
public Dictionary<string, string> QueryStringParameters { get; set; }

/// <summary>
/// The path parameters that were part of the request.
/// </summary>
public Dictionary<string, string> PathParameters { get; set; }

/// <summary>
/// The stage variables defined for the stage in API Gateway.
/// </summary>
public Dictionary<string, string> StageVariables { get; set; }

/// <summary>
/// The request context for the request.
/// </summary>
public APIGatewayHttpApiV2ProxyRequest.ProxyRequestContext RequestContext { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
namespace Amazon.Lambda.APIGatewayEvents
{
using System.Collections.Generic;
using System.Runtime.Serialization;

/// <summary>
/// An object representing the expected format of an API Gateway authorization response.
/// https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html
/// </summary>
[DataContract]
public class APIGatewayCustomAuthorizerV2SimpleResponse
{
/// <summary>
/// Gets or sets authorization result.
/// </summary>
[DataMember(Name = "isAuthorized")]
#if NETCOREAPP_3_1
[System.Text.Json.Serialization.JsonPropertyName("isAuthorized")]
#endif
public bool IsAuthorized { get; set; }

/// <summary>
/// Gets or sets the <see cref="APIGatewayCustomAuthorizerContext"/> property.
/// </summary>
[DataMember(Name = "context")]
#if NETCOREAPP_3_1
[System.Text.Json.Serialization.JsonPropertyName("context")]
#endif
public Dictionary<string, object> Context { get; set; }
}
}
Loading