Skip to contents

The object provides reusable security schemes for the API. These schemes may be referenced by name in the top-level security object or within paths objects.

Usage

class_security_schemes(
  name = character(),
  details = class_security_scheme_details(),
  ...,
  description = character()
)

Arguments

name

Character vector (required). Names by which security schemes will be referenced.

details

The details of each security scheme, as a class_security_scheme_details() object.

...

These dots are for future extensions and must be empty.

description

Character vector (optional). A short description for the security schemes. CommonMark syntax may be used for rich text representation.

Value

A security_schemes S7 object with details about security available for operations.

Examples

class_security_schemes()
#> <rapid::security_schemes>
#>  @ name       : chr(0) 
#>  @ details    : <rapid::security_scheme_details>  list()
#>  @ description: chr(0) 
class_security_schemes(
  name = c(
    "accountAuth",
    "resetPasswordAuth"
  ),
  details = class_security_scheme_details(
    class_oauth2_security_scheme(
      password_flow = class_oauth2_token_flow(
        token_url = "/account/authorization",
        scopes = class_scopes(
          name = c("Catalog", "Commerce", "Playback", "Settings"),
          description = c(
            "Access all read-only content",
            "Perform account-level transactions",
            "Allow playback of restricted content",
            "Modify account settings"
          )
        )
      )
    ),
    class_api_key_security_scheme(
      parameter_name = "authorization",
      location = "header"
    )
  )
)
#> <rapid::security_schemes>
#>  @ name       : chr [1:2] "accountAuth" "resetPasswordAuth"
#>  @ details    : <rapid::security_scheme_details> List of 2
#>  .. $ : <rapid::oauth2_security_scheme>
#>  ..  ..@ implicit_flow          : <rapid::oauth2_implicit_flow>
#>  .. .. .. @ refresh_url      : chr(0) 
#>  .. .. .. @ scopes           : <rapid::scopes>
#>  .. .. .. .. @ name       : chr(0) 
#>  .. .. .. .. @ description: chr(0) 
#>  .. .. .. @ authorization_url: chr(0) 
#>  ..  ..@ password_flow          : <rapid::oauth2_token_flow>
#>  .. .. .. @ refresh_url: chr(0) 
#>  .. .. .. @ scopes     : <rapid::scopes>
#>  .. .. .. .. @ name       : chr [1:4] "Catalog" "Commerce" "Playback" "Settings"
#>  .. .. .. .. @ description: chr [1:4] "Access all read-only content" "Perform account-level transactions" "Allow playback of restricted content" "Modify account settings"
#>  .. .. .. @ token_url  : chr "/account/authorization"
#>  ..  ..@ client_credentials_flow: <rapid::oauth2_token_flow>
#>  .. .. .. @ refresh_url: chr(0) 
#>  .. .. .. @ scopes     : <rapid::scopes>
#>  .. .. .. .. @ name       : chr(0) 
#>  .. .. .. .. @ description: chr(0) 
#>  .. .. .. @ token_url  : chr(0) 
#>  ..  ..@ authorization_code_flow: <rapid::oauth2_authorization_code_flow>
#>  .. .. .. @ refresh_url      : chr(0) 
#>  .. .. .. @ scopes           : <rapid::scopes>
#>  .. .. .. .. @ name       : chr(0) 
#>  .. .. .. .. @ description: chr(0) 
#>  .. .. .. @ authorization_url: chr(0) 
#>  .. .. .. @ token_url        : chr(0) 
#>  .. $ : <rapid::api_key_security_scheme>
#>  ..  ..@ parameter_name: chr "authorization"
#>  ..  ..@ location      : chr "header"
#>  @ description: chr(0)