Skip to content

Authorize by Lambda requires duplicated deployment of the authorizing function #4

@horyd

Description

@horyd

If you have an authorizing function shared across your app then it needs to be listed in each service.yml and the references to it from within that service.yml need to be namespaced in order for it to find the function. The following code works but is a bit yucky

functions:
  authorize:
    handler: src/authorize.handler
  get:
    handler: src/surveys.get
    events:
      - http:
          path: /
          method: get
          cors: ${self:custom.cors}
          authorizer: surveys-authorize
  post:
    handler: src/surveys.post
    events:
      - http:
          path: /
          method: post
          cors: ${self:custom.cors}
          authorizer: surveys-authorize

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions