Skip to content

(cli): Define a plugin contract #32099

@otaviomacedo

Description

@otaviomacedo

Describe the feature

Currently, there is an implicit contract between the CLI and authentication plugins. Plugin authors are supposed to write the main plugin logic in an implementation of the CredentialProviderSource interface. The module exported by the plugin should have an init() function that takes in an instance of PluginHost (implemented and provided at runtime by the CLI). PluginHost can be used to register one or more CredentialProviderSources. In addition, the getProvider() method in CredentialProviderSource receives the mode (ForReading or ForWriting) under which the CLI is operating for that particular call.

However, none of these types are guaranteed to be exposed, and there is no documentation on how they should be used. Make this contract explicit by exposing publicly documented types.

Use Case

Developers who want to write authentication plugins for the CDK need to have a clear understanding of how their code would interact with the CLI.

Proposed Solution

Create a new package, that exposes these types.

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.166.0

Environment details (OS name and version, etc.)

N/A

Metadata

Metadata

Assignees

Labels

effort/mediumMedium work item – several days of effortfeature-requestA feature should be added or improved.p2package/toolsRelated to AWS CDK Tools or CLI

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions