Skip to content

Commit

Permalink
Merge remote-tracking branch 'valeriomazzeo/patch-2'
Browse files Browse the repository at this point in the history
  • Loading branch information
patrick-webs committed May 13, 2020
2 parents f9e7f29 + b5e79e1 commit e27946a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@ const jwksClient = require('jwks-rsa');
const jwt = require('jsonwebtoken');
const util = require('util');

const getPolicyDocument = (effect, resource) => {
const getPolicyDocument = (effect, methodArn) => {

// parse the ARN from the incoming resource
var methodArnComponents = methodArn.split(':');
var apiOptions = methodArnComponents[5].split('/');
methodArnComponents[5] = [apiOptions[0], apiOptions[1], "*"].join('/');
var resource = methodArnComponents.join(':');

const policyDocument = {
Version: '2012-10-17', // default version
Statement: [{
Expand Down

0 comments on commit e27946a

Please sign in to comment.