Class: 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).
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.
description
description:
string
A short description for security scheme.
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]: $Properties
flow
flow:
Flow
The flow used by the OAuth2 security scheme. Valid values are "implicit", "password", "application" or "accessCode". Valid for oauth2.
in
in:
In
The location of the API key. Valid values are "query" or "header". Valid for apiKey.
name
name:
string
The name of the header or query parameter to be used. Valid for apiKey.
scopes?
optionalscopes?:$Properties|null
The available scopes for the OAuth2 security scheme. Valid for oauth2.
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.
type
type:
Type
The type of the security scheme. Valid values are "basic", "apiKey" or "oauth2".
Methods
toJSON()
toJSON():
object
Converts this SecurityScheme to JSON.
Returns
object
JSON object
create()
Call Signature
staticcreate(properties?):SecurityScheme&$Shape
Creates a new SecurityScheme instance using the specified properties.
Parameters
properties?
Properties to set
Returns
SecurityScheme & $Shape
SecurityScheme instance
Call Signature
staticcreate(properties?):SecurityScheme
Creates a new SecurityScheme instance using the specified properties.
Parameters
properties?
Properties to set
Returns
SecurityScheme
SecurityScheme instance
decode()
staticdecode(reader,length?):SecurityScheme&$Shape
Decodes a SecurityScheme message from the specified reader or buffer.
Parameters
reader
Uint8Array<ArrayBufferLike> | Reader
Reader or buffer to decode from
length?
number
Message length if known beforehand
Returns
SecurityScheme & $Shape
SecurityScheme
Throws
If the payload is not a reader or valid buffer
Throws
If required fields are missing
decodeDelimited()
staticdecodeDelimited(reader):SecurityScheme&$Shape
Decodes a SecurityScheme message from the specified reader or buffer, length delimited.
Parameters
reader
Uint8Array<ArrayBufferLike> | Reader
Reader or buffer to decode from
Returns
SecurityScheme & $Shape
SecurityScheme
Throws
If the payload is not a reader or valid buffer
Throws
If required fields are missing
encode()
staticencode(message,writer?):Writer
Encodes the specified SecurityScheme message. Does not implicitly grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.verify|verify messages.
Parameters
message
SecurityScheme message or plain object to encode
writer?
Writer
Writer to encode to
Returns
Writer
Writer
encodeDelimited()
staticencodeDelimited(message,writer?):Writer
Encodes the specified SecurityScheme message, length delimited. Does not implicitly grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.verify|verify messages.
Parameters
message
SecurityScheme message or plain object to encode
writer?
Writer
Writer to encode to
Returns
Writer
Writer
fromObject()
staticfromObject(object):SecurityScheme
Creates a SecurityScheme message from a plain object. Also converts values to their respective internal types.
Parameters
object
{[k: string]: any; }
Plain object
Returns
SecurityScheme
SecurityScheme
toObject()
statictoObject(message,options?):object
Creates a plain object from a SecurityScheme message. Also converts values to other types if specified.
Parameters
message
SecurityScheme
SecurityScheme
options?
IConversionOptions
Conversion options
Returns
object
Plain object