Documentation ¶
Index ¶
- Constants
- func FindResourceSecuredBy(r *raml.Resource) []raml.DefinitionChoice
- func GetMethodSecuredBy(apiDef *raml.APIDefinition, r *raml.Resource, m *raml.Method) []raml.DefinitionChoice
- func GetQuotedScopes(ss raml.DefinitionChoice) ([]string, error)
- func SecuritySchemeName(name string) string
- func Supported(ss raml.SecurityScheme) bool
- func ValidateScheme(name string, apiDef *raml.APIDefinition) bool
- type Security
Constants ¶
View Source
const ( Oauth2 = "OAuth 2.0" BasicAuthentication = "Basic Authentication" PassThrough = "Pass Through" )
Variables ¶
This section is empty.
Functions ¶
func FindResourceSecuredBy ¶
func FindResourceSecuredBy(r *raml.Resource) []raml.DefinitionChoice
find resource's securedBy recursively
func GetMethodSecuredBy ¶
func GetMethodSecuredBy(apiDef *raml.APIDefinition, r *raml.Resource, m *raml.Method) []raml.DefinitionChoice
GetMethodSecuredBy get SecuredBy field of a method
func GetQuotedScopes ¶
func GetQuotedScopes(ss raml.DefinitionChoice) ([]string, error)
get array of security scopes in the form of quoted string
func SecuritySchemeName ¶
return security scheme name that could be used in code
func Supported ¶
func Supported(ss raml.SecurityScheme) bool
Supported returns true if the security scheme is supported by go-raml
func ValidateScheme ¶
func ValidateScheme(name string, apiDef *raml.APIDefinition) bool
validate security scheme: - not empty - not 'null' - oauth2 -> we only support oauth2 now
Types ¶
type Security ¶
type Security struct { *raml.SecurityScheme Name string PackageName string Headers []*raml.Header QueryParams []*raml.NamedParameter }
security define a security scheme, we only support oauth2 now. we generate middleware that checking for oauth2 credential
Click to show internal directories.
Click to hide internal directories.