Builder

Builder for collecting security requirements for an operation.

Report a problem

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

The collected list of security requirement objects.

Functions

Link copied to clipboard
fun apiKey(name: String)

Adds an API key requirement using the given parameter name.

Link copied to clipboard
fun basic()

Adds an HTTP Basic authentication requirement.

Link copied to clipboard
fun oauth2(vararg scopes: String)

Adds an OAuth 2 requirement with optional scopes.

Link copied to clipboard
fun openIdConnect(vararg scopes: String)

Adds an OpenID Connect requirement with optional scopes.

Link copied to clipboard
fun optional()

Marks security as optional by adding an empty requirement object. This allows requests without any authentication to succeed.

Link copied to clipboard
fun requirement(schemes: Map<String, List<String>>)

Adds a security requirement with multiple schemes that must all be satisfied (AND relationship). Use this when multiple authentication schemes must be used simultaneously. Each call to this method creates an OR relationship (alternative).

fun requirement(scheme: String, scopes: List<String> = emptyList())

Adds a security requirement for the given scheme and scopes. Each call to this method creates an OR relationship (alternative).