CtxWithUser attaches an Identity to a context.
(ctx context.Context, userId entity.Id)
| 13 | |
| 14 | // CtxWithUser attaches an Identity to a context. |
| 15 | func CtxWithUser(ctx context.Context, userId entity.Id) context.Context { |
| 16 | return context.WithValue(ctx, identityCtxKey, userId) |
| 17 | } |
| 18 | |
| 19 | // UserFromCtx retrieves an IdentityCache from the context. |
| 20 | // If there is no identity in the context, ErrNotAuthenticated is returned. |
no outgoing calls