MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / RequireAuthorized

Method RequireAuthorized

pkg/interop/server_authz.go:31–36  ·  view source on GitHub ↗

RequireAuthorized returns an error if the given context is not authorized as neither Network Server nor Application Server.

(ctx context.Context)

Source from the content-addressed store, hash-verified

29// RequireAuthorized returns an error if the given context is not authorized as neither Network Server
30// nor Application Server.
31func (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.
39func (Authorizer) RequireAddress(ctx context.Context, addr string) error {

Callers 1

TestServerFunction · 0.95

Implementers 3

clusterAuthorizerpkg/joinserver/authorizer.go
applicationRightsAuthorizerpkg/joinserver/authorizer.go
Authorizerpkg/interop/server_authz.go

Calls 2

NewMethod · 0.65
ValueMethod · 0.45

Tested by 1

TestServerFunction · 0.76