Skip to content

Commit

Permalink
feat: support client cert properties (aws#469)
Browse files Browse the repository at this point in the history
  • Loading branch information
deki committed Sep 5, 2022
1 parent 98482d4 commit 4cc4a3b
Show file tree
Hide file tree
Showing 3 changed files with 183 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ public class ApiGatewayRequestIdentity {
private String accountId;
private String accessKey;

private String principalOrgId;

private ClientCert clientCert;

//-------------------------------------------------------------
// Methods - Getter/Setter
Expand Down Expand Up @@ -179,4 +182,91 @@ public String getAccessKey() {
public void setAccessKey(String accessKey) {
this.accessKey = accessKey;
}

public String getPrincipalOrgId() {
return principalOrgId;
}

public void setPrincipalOrgId(String principalOrgId) {
this.principalOrgId = principalOrgId;
}

public ClientCert getClientCert() {
return clientCert;
}

public void setClientCert(ClientCert clientCert) {
this.clientCert = clientCert;
}

public static class ClientCert {

private String clientCertPem;
private String issuerDN;
private String serialNumber;
private String subjectDN;
private Validity validity;

public String getClientCertPem() {
return clientCertPem;
}

public void setClientCertPem(String clientCertPem) {
this.clientCertPem = clientCertPem;
}

public String getIssuerDN() {
return issuerDN;
}

public void setIssuerDN(String issuerDN) {
this.issuerDN = issuerDN;
}

public String getSerialNumber() {
return serialNumber;
}

public void setSerialNumber(String serialNumber) {
this.serialNumber = serialNumber;
}

public String getSubjectDN() {
return subjectDN;
}

public void setSubjectDN(String subjectDN) {
this.subjectDN = subjectDN;
}

public Validity getValidity() {
return validity;
}

public void setValidity(Validity validity) {
this.validity = validity;
}
}

public static class Validity {

private String notAfter;
private String notBefore;

public String getNotAfter() {
return notAfter;
}

public void setNotAfter(String notAfter) {
this.notAfter = notAfter;
}

public String getNotBefore() {
return notBefore;
}

public void setNotBefore(String notBefore) {
this.notBefore = notBefore;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
package com.amazonaws.serverless.proxy.model;

public class HttpApiV2Authentication {
private ClientCert clientCert;

public ClientCert getClientCert() {
return clientCert;
}

public void setClientCert(ClientCert clientCert) {
this.clientCert = clientCert;
}

public static class ClientCert {

private String clientCertPem;
private String issuerDN;
private String serialNumber;
private String subjectDN;
private Validity validity;

public String getClientCertPem() {
return clientCertPem;
}

public void setClientCertPem(String clientCertPem) {
this.clientCertPem = clientCertPem;
}

public String getIssuerDN() {
return issuerDN;
}

public void setIssuerDN(String issuerDN) {
this.issuerDN = issuerDN;
}

public String getSerialNumber() {
return serialNumber;
}

public void setSerialNumber(String serialNumber) {
this.serialNumber = serialNumber;
}

public String getSubjectDN() {
return subjectDN;
}

public void setSubjectDN(String subjectDN) {
this.subjectDN = subjectDN;
}

public Validity getValidity() {
return validity;
}

public void setValidity(Validity validity) {
this.validity = validity;
}

public static class Validity {

private String notAfter;
private String notBefore;

public String getNotAfter() {
return notAfter;
}

public void setNotAfter(String notAfter) {
this.notAfter = notAfter;
}

public String getNotBefore() {
return notBefore;
}

public void setNotBefore(String notBefore) {
this.notBefore = notBefore;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public class HttpApiV2ProxyRequestContext {

private HttpApiV2HttpContext http;
private HttpApiV2AuthorizerMap authorizer;
private HttpApiV2Authentication authentication;

public String getAccountId() {
return accountId;
Expand Down Expand Up @@ -117,4 +118,12 @@ public void setAuthorizer(HttpApiV2AuthorizerMap authorizer) {
this.authorizer = authorizer;
}

public HttpApiV2Authentication getAuthentication() {
return authentication;
}

public void setAuthentication(HttpApiV2Authentication authentication) {
this.authentication = authentication;
}

}

0 comments on commit 4cc4a3b

Please sign in to comment.