serverless / serverless/serverless

Conditional custom authorizer depending on the stage

Open
#5,553 1 comment 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

cat/aws-event-api-gateway enhancement
Dominant language
JavaScript
Stars
46.9k
Forks
5.7k
Avg merge
10h 7m
Merged PRs (30d)
57

Description

This is a Feature Proposal

Description

The use case: You want to add a basic auth (using an authorizer) to access the staging environment but not for the production.
If the authorizer bloc would have an enabled attribute (like the pluging: serverless-domain-manager) we could do something like this:

custom:
  stage: ${opt:stage}
  staging_auth: true
  prod_auth: false 
...
     authorizer:
            enabled: ${custom:stage}_auth
            name: authorizerFunc
            ...

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The proposal concerns the custom stage setting and the authorizer block, with authorizerFunc as the referenced entry point. Start by tracing how stage variables and authorizer configuration are parsed; done means the authorizer can be enabled or disabled per stage, with both settings covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, javascript
Domain
authorization, cloud
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.