Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: Implementing the plugin version interface #19606

Merged
merged 4 commits into from
Mar 20, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions website/content/docs/plugins/plugin-development.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,22 @@ func main() {
And that's basically it! You would just need to change `myPlugin` to your actual
plugin.

### Implementing the Version interface
tomhjp marked this conversation as resolved.
Show resolved Hide resolved

Plugins can optionally self-report their own semantic version. For plugins that
do so, Vault will automatically populate the plugin's version in the catalog
without requiring the user to provide it. If users do provide a version during
registration, Vault will validate the version provided matches what the plugin
reports. Plugins that report a non-empty version _must_ report a valid
[Semantic Version](https://semver.org/) or registration will fail.

To implement the version interface, plugins using the Vault SDK package should
set the `RunningVersion` variable in the struct
[`framework.Backend`](https://github.com/hashicorp/vault/blob/main/sdk/framework/backend.go).

All other plugins should implement the `PluginVersion` service defined
in [`version.proto`](https://github.com/hashicorp/vault/blob/main/sdk/logical/version.proto).

## Plugin Backwards Compatibility with Vault

Let's take a closer look at a snippet from the above main package.
Expand Down