Expand description
OpenAPI security-scheme support.
Models the subset of OpenAPI 3 security used by v0.1 codegen:
apiKeyschemes (in: header | query | cookie)httpschemes withscheme: bearerorscheme: basic
oauth2 and openIdConnect are recognised at parse time and silently
skipped — operations that reference them behave as if they had no security
requirement so the rest of the spec still compiles. Multi-scheme AND
requirements (a single requirement object naming more than one scheme) emit
a compile_error! because v0.1 only supports OR of single-scheme
alternatives.
Structs§
- OpSecurity
- Resolved security requirements for one operation.
- Scheme
Info - One declared scheme from
components.securitySchemes.
Enums§
- ApiKey
In - Where an
apiKeycredential is carried. - Scheme
Kind - Concrete v0.1-supported scheme variants.
Functions§
- auth_
enum_ ident - Pascal-cased ident for an operation’s auth enum.
- auth_
param_ type - Compute the Rust type used as the trait method’s
authparameter. - auth_
state_ ident - Module-level identifier for the generated client auth-state struct.
- client_
auth_ trait_ ident - Module-level identifier for the generated client auth extension trait.
- collect_
schemes - Read
components.securitySchemesand keep only schemes supported in v0.1. - generate_
op_ auth_ enum - Generate one
{Op}Authenum per operation that has more than one alternative. - generate_
scheme_ types - Generate the top-level type definition for every declared scheme.
- generate_
unsupported_ and_ errors - Emit a
compile_error!token if any operation referenced a multi-scheme AND requirement that v0.1 cannot represent. - resolve_
alternatives - Returns the scheme infos referenced by an op’s alternatives, in declaration order.
- resolve_
op_ security - Resolve the effective security requirements for an operation.
- scheme_
by_ name - Look up a scheme by its raw name.
- scheme_
field_ ident - Per-scheme snake-case suffix for builder methods / state fields.