Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var APIKeyAuth = APIKeySecurity("api_key", func() {
Description("Secures endpoint by requiring an API key.")
})
APIKeyAuth defines a security scheme that uses API keys.
View Source
var BasicAuth = BasicAuthSecurity("basic", func() {
Description("Basic authentication used to authenticate security principal during signin")
})
BasicAuth defines a security scheme using basic authentication. The scheme protects the "signin" action used to create JWTs.
View Source
var Creds = Type("Creds", func() {
Field(1, "jwt", String, "JWT token", func() {
Example("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ")
})
Field(2, "api_key", String, "API Key", func() {
Example("abcdef12345")
})
Field(3, "oauth_token", String, "OAuth2 token", func() {
Example("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ")
})
Required("jwt", "api_key", "oauth_token")
})
Creds defines the credentials to use for authenticating to service methods.
View Source
var JWTAuth = JWTSecurity("jwt", func() {
Description(`Secures endpoint by requiring a valid JWT token retrieved via the signin endpoint. Supports scopes "api:read" and "api:write".`)
Scope("api:read", "Read-only access")
Scope("api:write", "Read and write access")
})
JWTAuth defines a security scheme that uses JWT tokens.
View Source
var OAuth2Auth = OAuth2Security("oauth2", func() {
AuthorizationCodeFlow("http://goa.design/authorization", "http://goa.design/token", "http://goa.design/refresh")
Description(`Secures endpoint by requiring a valid OAuth2 token retrieved via the signin endpoint. Supports scopes "api:read" and "api:write".`)
Scope("api:read", "Read-only access")
Scope("api:write", "Read and write access")
})
OAuth2Auth defines a security scheme that uses OAuth2 tokens.
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.