google

package
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2026 License: MIT Imports: 10 Imported by: 0

README

key/google

Google Secret Manager 实现由 key.NewKey 内部使用。Google SDK 使用 Application Default Credentials 或 工作负载身份。

type: google
scope: prod/order-service
root_name: kratos-root
google:
  project: example-project

root_name 也可以直接写成 projects/{project}/secrets/{secret} 完整资源名。

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFromConfig

func NewFromConfig(ctx context.Context, cfg *configv1.Key) (internal.Provider, error)

NewFromConfig 根据 Key 配置创建 Google Secret Manager Provider。 Google SDK 使用 Application Default Credentials 或工作负载身份。

Types

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

Provider 从 Google Secret Manager 读取密钥。

func New

func New(ctx context.Context, opts ...option.ClientOption) (*Provider, error)

New 创建 Google Secret Manager Provider。

func NewWithProject

func NewWithProject(ctx context.Context, project string, opts ...option.ClientOption) (*Provider, error)

NewWithProject 创建支持使用短 Secret 名称的 Google Secret Manager Provider。

func (*Provider) Close

func (p *Provider) Close() error

Close 关闭 Google Secret Manager 客户端。

func (*Provider) Get

func (p *Provider) Get(ctx context.Context, name string) (internal.Secret, error)

Get 读取 Google Secret Manager 中最新版本的密钥值。 Name 可以是 projects/{project}/secrets/{secret}。

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL