Class: SecurityScheme
protoc_gen_openapiv2.options.SecurityScheme
SecurityScheme is a representation of OpenAPI v2 specification's
Security Scheme object.
See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#securitySchemeObject
Allows the definition of a security scheme that can be used by the operations. Supported schemes are basic authentication, an API key (either as a header or as a query parameter) and OAuth2's common flows (implicit, password, application and access code).
Implements
Constructors
constructor
• new SecurityScheme(properties?): SecurityScheme
Constructs a new SecurityScheme.
Parameters
| Name | Type | Description |
|---|---|---|
properties? | ISecurityScheme | Properties to set |
Returns
Properties
authorizationUrl
• authorizationUrl: string
The authorization URL to be used for this flow. This SHOULD be in the form of a URL. Valid for oauth2/implicit and oauth2/accessCode.
Implementation of
ISecurityScheme.authorizationUrl
description
• description: string
A short description for security scheme.
Implementation of
extensions
• extensions: Object
Custom properties that start with "x-" such as "x-foo" used to describe extra functionality that is not covered by the standard OpenAPI Specification. See: https://swagger.io/docs/specification/2-0/swagger-extensions/
Index signature
▪ [k: string]: IValue
Implementation of
flow
• flow: Flow
The flow used by the OAuth2 security scheme. Valid values are "implicit", "password", "application" or "accessCode". Valid for oauth2.
Implementation of
in
• in: In
The location of the API key. Valid values are "query" or "header". Valid for apiKey.
Implementation of
name
• name: string
The name of the header or query parameter to be used. Valid for apiKey.
Implementation of
scopes
• Optional scopes: null | IScopes
The available scopes for the OAuth2 security scheme. Valid for oauth2.
Implementation of
tokenUrl
• tokenUrl: string
The token URL to be used for this flow. This SHOULD be in the form of a URL. Valid for oauth2/password, oauth2/application and oauth2/accessCode.
Implementation of
type
• type: Type
The type of the security scheme. Valid values are "basic", "apiKey" or "oauth2".
Implementation of
Methods
toJSON
▸ toJSON(): Object
Converts this SecurityScheme to JSON.
Returns
Object
JSON object
create
▸ create(properties?): SecurityScheme
Creates a new SecurityScheme instance using the specified properties.
Parameters
| Name | Type | Description |
|---|---|---|
properties? | ISecurityScheme | Properties to set |
Returns
SecurityScheme instance
decode
▸ decode(reader, length?): SecurityScheme
Decodes a SecurityScheme message from the specified reader or buffer.
Parameters
| Name | Type | Description |
|---|---|---|
reader | Uint8Array | Reader | Reader or buffer to decode from |
length? | number | Message length if known beforehand |
Returns
SecurityScheme
Throws
If the payload is not a reader or valid buffer
Throws
If required fields are missing
decodeDelimited
▸ decodeDelimited(reader): SecurityScheme
Decodes a SecurityScheme message from the specified reader or buffer, length delimited.
Parameters
| Name | Type | Description |
|---|---|---|
reader | Uint8Array | Reader | Reader or buffer to decode from |
Returns
SecurityScheme
Throws
If the payload is not a reader or valid buffer
Throws
If required fields are missing
encode
▸ encode(message, writer?): Writer
Encodes the specified SecurityScheme message. Does not implicitly grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.verify|verify messages.
Parameters
| Name | Type | Description |
|---|---|---|
message | ISecurityScheme | SecurityScheme message or plain object to encode |
writer? | Writer | Writer to encode to |
Returns
Writer
Writer
encodeDelimited
▸ encodeDelimited(message, writer?): Writer
Encodes the specified SecurityScheme message, length delimited. Does not implicitly grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.verify|verify messages.
Parameters
| Name | Type | Description |
|---|---|---|
message | ISecurityScheme | SecurityScheme message or plain object to encode |
writer? | Writer | Writer to encode to |
Returns
Writer
Writer
fromObject
▸ fromObject(object): SecurityScheme
Creates a SecurityScheme message from a plain object. Also converts values to their respective internal types.
Parameters
| Name | Type | Description |
|---|---|---|
object | Object | Plain object |
Returns
SecurityScheme
getTypeUrl
▸ getTypeUrl(typeUrlPrefix?): string
Gets the default type url for SecurityScheme
Parameters
| Name | Type | Description |
|---|---|---|
typeUrlPrefix? | string | your custom typeUrlPrefix(default "type.googleapis.com") |
Returns
string
The default type url
toObject
▸ toObject(message, options?): Object
Creates a plain object from a SecurityScheme message. Also converts values to other types if specified.
Parameters
| Name | Type | Description |
|---|---|---|
message | SecurityScheme | SecurityScheme |
options? | IConversionOptions | Conversion options |
Returns
Object
Plain object