Skip to content

Commit

Permalink
chore: use principalId instead of user
Browse files Browse the repository at this point in the history
  • Loading branch information
frsechet authored and dnalborczyk committed Sep 11, 2019
1 parent df38a11 commit ba13812
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/createAuthScheme.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,8 @@ module.exports = function createAuthScheme(
credentials: {
context: policy.context,
usageIdentifierKey: policy.usageIdentifierKey,
user: policy.principalId,
enhancedAuthContext,
principalId: policy.principalId,
},
}),
);
Expand Down
2 changes: 1 addition & 1 deletion src/createLambdaProxyEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports = function createLambdaProxyEvent(
stageVariables,
) {
const authPrincipalId =
request.auth && request.auth.credentials && request.auth.credentials.user;
request.auth && request.auth.credentials && request.auth.credentials.principalId;
const authContext =
(request.auth &&
request.auth.credentials &&
Expand Down
3 changes: 1 addition & 2 deletions src/createVelocityContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,11 @@ function escapeJavaScript(x) {
*/
module.exports = function createVelocityContext(request, options, payload) {
const path = (x) => jsonPath(payload || {}, x);
const authPrincipalId =
request.auth && request.auth.credentials && request.auth.credentials.user;
const enhancedAuthContext =
request.auth &&
request.auth.credentials &&
request.auth.credentials.enhancedAuthContext;
const authPrincipalId = request.auth && request.auth.credentials && request.auth.credentials.principalId;
const headers = request.unprocessedHeaders;

let token = headers && (headers.Authorization || headers.authorization);
Expand Down

0 comments on commit ba13812

Please sign in to comment.