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

V1.37.0 #167

Merged
merged 2 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
20 changes: 20 additions & 0 deletions api/authorizer/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,26 @@ func (auth *Client) CACertificate(caID, filename string) error {
return err
}

// CAConfig get authorizers root certificate config by ca type.
func (auth *Client) CAConfig(caType string) (ComponentCaConfig, error) {
caConf := ComponentCaConfig{}

_, err := auth.api.
URL("/authorizer/api/v1/%s/cas/config", caType).
Get(&caConf)

return caConf, err
}

// UpdateCAConfig update authorizers root certificate config by ca type.
func (auth *Client) UpdateCAConfig(caType string, caConf ComponentCaConfig) error {
_, err := auth.api.
URL("/authorizer/api/v1/%s/cas/config", caType).
Put(&caConf)

return err
}

// CertificateRevocationList gets authorizer CA's certificate revocation list.
func (auth *Client) CertificateRevocationList(caID, filename string) error {
err := auth.api.
Expand Down
9 changes: 9 additions & 0 deletions api/authorizer/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,3 +271,12 @@ type CheckoutResult struct {
Count int `json:"count"`
Items []Checkout `json:"items"`
}

// ComponentCaConfig component ca config response definition.
type ComponentCaConfig struct {
Name string `json:"name"`
CAID string `json:"ca_id"`
PrimaryCAID string `json:"primary_ca_id"`
Updated time.Time `json:"updated"`
UpdatedBy string `json:"updated_by,omitempty"`
}
11 changes: 11 additions & 0 deletions api/secretsmanager/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,17 @@ func (s *Client) RefreshTargetDomain(tdId string) error {
return err
}

// ResolveTargetDomains resolve target domain names to target domain IDs.
func (s *Client) ResolveTargetDomains(tdNames []string) (TargetDomainsResolveResponse, error) {
resolve := TargetDomainsResolveResponse{}

_, err := s.api.
URL("/secrets-manager/api/v1/targetdomains/resolve").
Post(tdNames, &resolve)

return resolve, err
}

// MARK: Target domain accounts
// TargetDomainAccounts lists all accounts in target domain
func (s *Client) TargetDomainAccounts(offset, limit int, sortkey, sortdir, tdId string) (ScannedAccountResult, error) {
Expand Down
10 changes: 10 additions & 0 deletions api/secretsmanager/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,3 +280,13 @@ type ManagedAccountResult struct {
Count int `json:"count"`
Items []ManagedAccount `json:"items"`
}

type TargetDomainsResolveResponse struct {
Count int `json:"count"`
Items []TargetDomainsResolve `json:"items"`
}

type TargetDomainsResolve struct {
ID string `json:"id"`
TargetDomainName string `json:"target_domain_name"`
}