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

Function NewContextWithHashValidator

pkg/auth/password.go:47–49  ·  view source on GitHub ↗

NewContextWithHashValidator returns a context derived from parent that contains hashValidator.

(parent context.Context, hashValidator HashValidator)

Source from the content-addressed store, hash-verified

45
46// NewContextWithHashValidator returns a context derived from parent that contains hashValidator.
47func NewContextWithHashValidator(parent context.Context, hashValidator HashValidator) context.Context {
48 return context.WithValue(parent, hashValidatorContextKey, hashValidator)
49}
50
51// HashValidatorFromContext returns the HashValidator from the context if present. Otherwise it returns default HashValidator.
52func HashValidatorFromContext(ctx context.Context) HashValidator {

Callers 10

SaveAccessMethod · 0.92
initFunction · 0.92
GenerateAPIKeyFunction · 0.92
TestEntityAccessFunction · 0.92
NewAPIKeyMethod · 0.92
NewUserSessionMethod · 0.92
PopulateMethod · 0.92
initFunction · 0.92
CreateUserSessionMethod · 0.92
TestHashFunction · 0.85

Calls

no outgoing calls

Tested by 4

initFunction · 0.74
TestEntityAccessFunction · 0.74
initFunction · 0.74
TestHashFunction · 0.68