feat(vault-tui): implement KV client and service for managing secrets
- Added internal/vault/client.go for creating a Vault client with configuration settings. - Introduced internal/vault/errors.go to classify Vault API errors for better UI handling. - Created internal/vault/kv.go to manage KV secrets, including listing, reading, writing, and deleting operations. - Implemented internal/vault/mounts.go to list and describe secret engine mounts. - Developed internal/vault/service.go to provide a unified entry point for Vault operations. - Added internal/vault/kv_test.go for comprehensive testing of KV operations. - Introduced internal/ui/toast.go for transient notifications in the UI. - Added renovate.json for dependency management and updates.
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
package oidc
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"html"
|
||||
)
|
||||
|
||||
// successHTML/errorHTML are served back to the browser tab, never to
|
||||
// stdout/stderr or any log — the request they respond to may still carry
|
||||
// the authorization code in its query string.
|
||||
func successHTML() []byte {
|
||||
return []byte(`<!DOCTYPE html><html><head><title>vault-tui</title><meta charset="utf-8"></head>
|
||||
<body style="font-family:sans-serif;text-align:center;margin-top:15%">
|
||||
<h2>Signed in</h2><p>You can close this tab and return to vault-tui.</p>
|
||||
</body></html>`)
|
||||
}
|
||||
|
||||
func errorHTML(err error) []byte {
|
||||
msg := html.EscapeString(err.Error())
|
||||
return []byte(fmt.Sprintf(`<!DOCTYPE html><html><head><title>vault-tui</title><meta charset="utf-8"></head>
|
||||
<body style="font-family:sans-serif;text-align:center;margin-top:15%%">
|
||||
<h2>Sign-in failed</h2><p>%s</p><p>Return to vault-tui and try again.</p>
|
||||
</body></html>`, msg))
|
||||
}
|
||||
Reference in New Issue
Block a user