# OasSecurityRequirement

CLASS in `@skmtc/core 0.63.4`

The security schemes that a request needs together. When an operation has
more than one requirement, a request needs to satisfy only one of them.

A requirement with no schemes lets a request have no security.

## Signature

```ts
import { OasSecurityRequirement } from '@skmtc/core'

class OasSecurityRequirement
```

## Constructor

### constructor

```ts
constructor(fields: SecurityFields, oasDocument: OasDocument)
```

## Properties

- `oasType` ('securityRequirement')
- `requirement` (Record<string, string[]>): The name of each scheme, with the scopes that the request needs.

## Methods

### toSecurityScheme

```ts
toSecurityScheme(): OasSecurityScheme[]
```

The schemes that `requirement` names, without their names and scopes. It
leaves out `mutualTLS` schemes, which core does not parse, so it can give
fewer schemes than a request needs.

Throws:

- `DanglingRefError`: when a scheme is a reference that names nothing and `parse.danglingRefs` keeps it

### toJsonSchema

```ts
toJsonSchema(): OpenAPIV3.SecurityRequirementObject
```
