RequireAuthorized returns an error if the given context is not authorized as neither Network Server nor Application Server.
(ctx context.Context)
| 29 | // RequireAuthorized returns an error if the given context is not authorized as neither Network Server |
| 30 | // nor Application Server. |
| 31 | func (Authorizer) RequireAuthorized(ctx context.Context) error { |
| 32 | if ctx.Value(nsAuthInfoKey) != nil || ctx.Value(asAuthInfoKey) != nil { |
| 33 | return nil |
| 34 | } |
| 35 | return errUnauthenticated.New() |
| 36 | } |
| 37 | |
| 38 | // RequireAddress returns an error if the given address is not authorized in the context. |
| 39 | func (Authorizer) RequireAddress(ctx context.Context, addr string) error { |