-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e8ccc60
commit 4729c5b
Showing
5 changed files
with
87 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package plugin | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/hashicorp/vault/sdk/framework" | ||
"github.com/hashicorp/vault/sdk/logical" | ||
"github.com/thevilledev/vault-plugin-secrets-vercel/internal/version" | ||
) | ||
|
||
const ( | ||
pathPatternInfo = "info" | ||
) | ||
|
||
func (b *backend) pathInfo() []*framework.Path { | ||
return []*framework.Path{ | ||
{ | ||
Pattern: pathPatternInfo, | ||
Operations: map[logical.Operation]framework.OperationHandler{ | ||
logical.ReadOperation: &framework.PathOperation{ | ||
Callback: b.pathInfoRead, | ||
}, | ||
}, | ||
}, | ||
} | ||
} | ||
|
||
func (b *backend) pathInfoRead( | ||
_ context.Context, | ||
_ *logical.Request, | ||
_ *framework.FieldData, | ||
) (*logical.Response, error) { | ||
return &logical.Response{ | ||
Data: map[string]any{ | ||
"build_date": version.BuildDate, | ||
"build_version": version.Version, | ||
"build_commit": version.Commit, | ||
"build_commit_date": version.CommitDate, | ||
"build_branch": version.Branch, | ||
"build_tag": version.Tag, | ||
"build_dirty": version.Dirty, | ||
}, | ||
}, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package version | ||
|
||
var ( | ||
BuildDate string | ||
Version string | ||
Commit string | ||
CommitDate string | ||
Branch string | ||
Tag string | ||
Dirty string | ||
) |