Skip to main content

Module security

Module security 

Source
Expand description

OpenAPI security-scheme support.

Models the subset of OpenAPI 3 security used by v0.1 codegen:

  • apiKey schemes (in: header | query | cookie)
  • http schemes with scheme: bearer or scheme: 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.
SchemeInfo
One declared scheme from components.securitySchemes.

Enums§

ApiKeyIn
Where an apiKey credential is carried.
SchemeKind
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 auth parameter.
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.securitySchemes and keep only schemes supported in v0.1.
generate_op_auth_enum
Generate one {Op}Auth enum 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.