Skip to content

[Question] Auth middleware example #534

Open
@hotrush

Description

@hotrush

Hello, checking auth middleware example (https://github.com/grpc-ecosystem/go-grpc-middleware/tree/master/auth#L36) and have several questions:

  • what does this line do? grpc_ctxtags.Extract(ctx).Set("auth.sub", userClaimFromToken(tokenInfo))
  • also // WARNING: in production define your own type to avoid context collisions - do you suggest to define custom context type? but why? as i know it is a bad practice

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions