Documentation
¶
Index ¶
- type AuditEntry
- type Item
- type SaveInput
- type Store
- func (s *Store) Audit(ctx context.Context, credentialID int64, limit int) ([]AuditEntry, error)
- func (s *Store) Delete(ctx context.Context, id int64, actor string) error
- func (s *Store) Get(ctx context.Context, id int64, taskID int64) (*Item, error)
- func (s *Store) List(ctx context.Context, taskID, assetID int64, kind string) ([]Item, error)
- func (s *Store) ListByHost(ctx context.Context, taskID int64, host, kind string) ([]Item, error)
- func (s *Store) Reveal(ctx context.Context, id, taskID int64, actor string) (*Item, error)
- func (s *Store) Save(ctx context.Context, in SaveInput, actor string) (int64, error)
- func (s *Store) Touch(ctx context.Context, id, taskID, intentID int64, actor string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuditEntry ¶
type Item ¶
type Item struct {
ID int64 `json:"id"`
TaskID int64 `json:"task_id,omitempty"`
AssetID int64 `json:"asset_id,omitempty"`
Kind string `json:"kind"`
Username string `json:"username,omitempty"`
Secret string `json:"secret,omitempty"`
SecretHint string `json:"secret_hint,omitempty"`
Privilege string `json:"privilege,omitempty"`
Meta json.RawMessage `json:"meta,omitempty"`
ExpiresAt *time.Time `json:"expires_at,omitempty"`
CreatedAt time.Time `json:"created_at"`
LastUsedAt *time.Time `json:"last_used_at,omitempty"`
}
Item 是凭据的元数据;Secret 只在 Get/Reveal 时填充。
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) ListByHost ¶
ListByHost 按站点(域名/IP)查询凭据:匹配资产的 domain / root_domain / ip / bound_domains,以及凭据 meta 里显式记录的 host。返回掩码元数据,不含明文。
任务语义与 List 一致:taskID>0 看本任务与全局,taskID=0 只看全局, taskID<0 为管理端全量。