ActorFromContext returns the authorization subject from the context. All authentication flows should set the authorization subject in the context. If no actor is present, the function returns false.
(ctx context.Context)
| 209 | // All authentication flows should set the authorization subject in the context. |
| 210 | // If no actor is present, the function returns false. |
| 211 | func ActorFromContext(ctx context.Context) (rbac.Subject, bool) { |
| 212 | a, ok := ctx.Value(authContextKey{}).(rbac.Subject) |
| 213 | return a, ok |
| 214 | } |
| 215 | |
| 216 | var ( |
| 217 | subjectProvisionerd = rbac.Subject{ |