Skip to content

Commit

Permalink
sync the correct response from api for host credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
hokenssh committed Apr 29, 2022
1 parent 74ddc1c commit ac74cd0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/authorizer/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ func (auth *Client) CertificateRevocationList(caID, filename string) error {
}

// TargetHostCredentials get target host credentials for the user
func (auth *Client) TargetHostCredentials(authorizer *AuthorizationRequest) (*Principal, error) {
principal := &Principal{}
func (auth *Client) TargetHostCredentials(authorizer *AuthorizationRequest) (*ApiIdentitiesResponse, error) {
principal := &ApiIdentitiesResponse{}

_, err := auth.api.
URL("/authorizer/api/v1/ca/authorize").
Expand Down
14 changes: 14 additions & 0 deletions api/authorizer/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,20 @@ type Principal struct {
Size int `json:"size,omitempty"`
}

type ApiSshCertificate struct {
Type string `json:"type"`
Data string `json:"data"`
DataString string `json:"data_string"`
Chain []string `json:"chain"`
}
type ApiIdentitiesResponse struct {
Certificates []ApiSshCertificate `json:"certificates"`
PrincipalKeys []Principal `json:"principal_keys"`
Passphrase string `json:"passphrase,omitempty"`
ResponseCode int `json:"response_code"`
Message string `json:"message"`
}

// CA is root certificate representation
type CA struct {
ID string `json:"id"`
Expand Down

0 comments on commit ac74cd0

Please sign in to comment.