Skip to content

Added new template for combined firstParty and Enforcer lambdas #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

EldarHuman
Copy link
Contributor

No description provided.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest reorganizing the files and directories for clarity. What I might do is have the most basic usage of our library in the src directory and then have another sub-folder for additional examples (combined enforcer + first party, async config, etc) that won't be compiled.

src/

  • HumanFirstPartyLambda
  • HumanEnforceLambda
  • HumanActivitiesLambda
  • code_samples/
    • EnforceAndFirstPartyOriginRequestLambda
    • AsyncConfigLambdaExample
    • ...

Or something like this.

Comment on lines +18 to +19
const enforcer = HumanSecurityEnforcer.initialize(config);
const firstParty = HumanSecurityFirstParty.initialize(config);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be initialized once instead of on every invocation of the handler. Store them in global variables and reuse them.

@@ -3,7 +3,7 @@ set -e

# variable declarations
build_dir=dist
lambdas=( PXEnforcer PXFirstParty PXActivities )
lambdas=( PXEnforcer PXFirstParty PXActivities PXCombined_Enforcer_FirstParty)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants