MCPcopy Index your code
hub / github.com/oapi-codegen/oapi-codegen / hasSecurityScopes

Function hasSecurityScopes

internal/test/issues/issue518/main_test.go:27–30  ·  view source on GitHub ↗

hasSecurityScopes returns true if the BearerAuthScopes key was set in context, even if the scopes slice is empty (an empty slice means the security scheme is defined on the operation with no required scopes, which still requires auth).

(c *fiber.Ctx)

Source from the content-addressed store, hash-verified

25// even if the scopes slice is empty (an empty slice means the security scheme is
26// defined on the operation with no required scopes, which still requires auth).
27func hasSecurityScopes(c *fiber.Ctx) bool {
28 _, ok := c.Context().UserValue(BearerAuthScopes).([]string)
29 return ok
30}
31
32func TestIssue518(t *testing.T) {
33 server := &impl{}

Callers 1

TestIssue518Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…