danielgtaylor / openapi-cli-generator

Generate a CLI from an OpenAPI 3 specification
MIT License
179 stars 49 forks source link

Support multi-auth in generated CLIs #28

Closed danielgtaylor closed 4 years ago

danielgtaylor commented 4 years ago

This adds a new mechanism to register auth middleware and allows setting up multiple types of auth in a single generated CLI.

For example, you may want individual user's to log in but also support a machine-to-machine scenario for scripting and services. You would set up an AuthCode-based flow for users and a ClientCredentials-based flow for getting machine-to-machine tokens.

This change is backward compatible and the old calls continue to work (in fact, they are now built on top of the new UseAuth(...) functionality).