MCPcopy Create free account
hub / github.com/goadesign/goa / APIKey

Function APIKey

dsl/security.go:509–512  ·  view source on GitHub ↗

APIKey defines the attribute used to provide the API key to an endpoint secured with API keys. The parameters and usage of APIKey are the same as the Attribute function except that it accepts an extra first argument corresponding to the name of the API key security scheme. The generated code produc

(scheme, name string, args ...any)

Source from the content-addressed store, hash-verified

507// })
508// })
509func APIKey(scheme, name string, args ...any) {
510 args = useDSL(args, func() { Meta("security:apikey:"+scheme, scheme) })
511 Attribute(name, args...)
512}
513
514// APIKeyField is syntactic sugar to define an API key attribute with the
515// "rpc:tag" meta set with the value of the first argument.

Callers 7

openapi_dsls.goFile · 0.85
dsls.goFile · 0.85
TestTooManyArgErrorFunction · 0.85
security_dsls.goFile · 0.85
service_dsls.goFile · 0.85

Calls 3

useDSLFunction · 0.85
MetaFunction · 0.85
AttributeFunction · 0.85

Tested by 1

TestTooManyArgErrorFunction · 0.68