Skip to content

Support for API key  #798

@pmcelhaney

Description

@pmcelhaney

Counterfact doesn't currently read the security object of the OpenAPI schema.

When generating types, it should take that object into account.

For example, if the security object is defined as:

{
  "type": "apiKey",
  "name": "api_key",
  "in": "header"
}

Then Counterfact should act as if every operation has a required request header named "api_key" when generating code.

Note: this only covers "apiKey" authentication. OpenAPI also "http", "mutualTLS", "oauth2", "openIdConnect". Eventually we'll want to support "http" and "oauth2" as well. I'm not sure the others worth pursuing.

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions