mirror of
https://github.com/hanzokms/cli.git
synced 2026-10-30 20:30:00 +00:00
Infisical->KMS across all .go (identifiers + env-var keys + brand strings), e2e env vars + e2e/packages/infisical->kms dir. Only external published deps remain: github.com/infisical/go-sdk + infisical-kmip API symbols (kmsSdk.NewInfisicalClient etc.) and the forked keyring's INFISICAL_VAULT_FILE_PASSPHRASE env contract — these need upstream forks to rename.
981 lines
33 KiB
Go
981 lines
33 KiB
Go
package api
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/hanzokms/cli/packages/models"
|
|
)
|
|
|
|
// Stores info for login one
|
|
type LoginOneRequest struct {
|
|
Email string `json:"email"`
|
|
ClientPublicKey string `json:"clientPublicKey"`
|
|
}
|
|
|
|
type LoginOneResponse struct {
|
|
ServerPublicKey string `json:"serverPublicKey"`
|
|
ServerSalt string `json:"salt"`
|
|
}
|
|
|
|
// Stores info for login two
|
|
|
|
type LoginTwoRequest struct {
|
|
Email string `json:"email"`
|
|
ClientProof string `json:"clientProof"`
|
|
}
|
|
|
|
type LoginTwoResponse struct {
|
|
JTWToken string `json:"token"`
|
|
RefreshToken string `json:"refreshToken"`
|
|
PublicKey string `json:"publicKey"`
|
|
EncryptedPrivateKey string `json:"encryptedPrivateKey"`
|
|
IV string `json:"iv"`
|
|
Tag string `json:"tag"`
|
|
}
|
|
|
|
type PullSecretsRequest struct {
|
|
Environment string `json:"environment"`
|
|
}
|
|
|
|
type PullSecretsResponse struct {
|
|
Secrets []struct {
|
|
ID string `json:"_id"`
|
|
Workspace string `json:"workspace"`
|
|
Type string `json:"type"`
|
|
Environment string `json:"environment"`
|
|
SecretKeyCiphertext string `json:"secretKeyCiphertext"`
|
|
SecretKeyIV string `json:"secretKeyIV"`
|
|
SecretKeyTag string `json:"secretKeyTag"`
|
|
SecretKeyHash string `json:"secretKeyHash"`
|
|
SecretValueCiphertext string `json:"secretValueCiphertext"`
|
|
SecretValueIV string `json:"secretValueIV"`
|
|
SecretValueTag string `json:"secretValueTag"`
|
|
SecretValueHash string `json:"secretValueHash"`
|
|
V int `json:"__v"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
User string `json:"user,omitempty"`
|
|
} `json:"secrets"`
|
|
Key struct {
|
|
ID string `json:"_id"`
|
|
EncryptedKey string `json:"encryptedKey"`
|
|
Nonce string `json:"nonce"`
|
|
Sender struct {
|
|
ID string `json:"_id"`
|
|
Email string `json:"email"`
|
|
CustomerID string `json:"customerId"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
V int `json:"__v"`
|
|
FirstName string `json:"firstName"`
|
|
LastName string `json:"lastName"`
|
|
PublicKey string `json:"publicKey"`
|
|
} `json:"sender"`
|
|
Receiver string `json:"receiver"`
|
|
Workspace string `json:"workspace"`
|
|
V int `json:"__v"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
} `json:"key"`
|
|
}
|
|
|
|
type PullSecretsByKMSTokenResponse struct {
|
|
Secrets []struct {
|
|
ID string `json:"_id"`
|
|
Workspace string `json:"workspace"`
|
|
Type string `json:"type"`
|
|
Environment string `json:"environment"`
|
|
SecretKey struct {
|
|
Workspace string `json:"workspace"`
|
|
Ciphertext string `json:"ciphertext"`
|
|
Iv string `json:"iv"`
|
|
Tag string `json:"tag"`
|
|
Hash string `json:"hash"`
|
|
} `json:"secretKey"`
|
|
SecretValue struct {
|
|
Workspace string `json:"workspace"`
|
|
Ciphertext string `json:"ciphertext"`
|
|
Iv string `json:"iv"`
|
|
Tag string `json:"tag"`
|
|
Hash string `json:"hash"`
|
|
} `json:"secretValue"`
|
|
} `json:"secrets"`
|
|
Key struct {
|
|
EncryptedKey string `json:"encryptedKey"`
|
|
Nonce string `json:"nonce"`
|
|
Sender struct {
|
|
PublicKey string `json:"publicKey"`
|
|
} `json:"sender"`
|
|
Receiver struct {
|
|
RefreshVersion int `json:"refreshVersion"`
|
|
ID string `json:"_id"`
|
|
Email string `json:"email"`
|
|
CustomerID string `json:"customerId"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
V int `json:"__v"`
|
|
FirstName string `json:"firstName"`
|
|
LastName string `json:"lastName"`
|
|
PublicKey string `json:"publicKey"`
|
|
} `json:"receiver"`
|
|
Workspace string `json:"workspace"`
|
|
} `json:"key"`
|
|
}
|
|
|
|
type GetWorkSpacesResponse struct {
|
|
Workspaces []struct {
|
|
ID string `json:"_id"`
|
|
Name string `json:"name"`
|
|
Plan string `json:"plan,omitempty"`
|
|
V int `json:"__v"`
|
|
OrganizationId string `json:"orgId"`
|
|
} `json:"workspaces"`
|
|
}
|
|
|
|
type GetProjectByIdResponse struct {
|
|
Project Project `json:"workspace"`
|
|
}
|
|
|
|
type GetProjectBySlugResponse Project
|
|
|
|
type CertificateProfile struct {
|
|
ID string `json:"id"`
|
|
Name string `json:"name"`
|
|
Description string `json:"description"`
|
|
ProjectID string `json:"projectId"`
|
|
CaID string `json:"caId"`
|
|
CertificateTemplateID string `json:"certificateTemplateId"`
|
|
}
|
|
|
|
type GetCertificateProfileResponse struct {
|
|
CertificateProfile CertificateProfile `json:"certificateProfile"`
|
|
}
|
|
|
|
type GetOrganizationsResponse struct {
|
|
Organizations []struct {
|
|
ID string `json:"id"`
|
|
Name string `json:"name"`
|
|
} `json:"organizations"`
|
|
}
|
|
|
|
type SelectOrganizationResponse struct {
|
|
Token string `json:"token"`
|
|
MfaEnabled bool `json:"isMfaEnabled"`
|
|
MfaMethod string `json:"mfaMethod"`
|
|
}
|
|
|
|
type SelectOrganizationRequest struct {
|
|
OrganizationId string `json:"organizationId"`
|
|
}
|
|
|
|
type Secret struct {
|
|
SecretKeyCiphertext string `json:"secretKeyCiphertext,omitempty"`
|
|
SecretKeyIV string `json:"secretKeyIV,omitempty"`
|
|
SecretKeyTag string `json:"secretKeyTag,omitempty"`
|
|
SecretKeyHash string `json:"secretKeyHash,omitempty"`
|
|
SecretValueCiphertext string `json:"secretValueCiphertext,omitempty"`
|
|
SecretValueIV string `json:"secretValueIV,omitempty"`
|
|
SecretValueTag string `json:"secretValueTag,omitempty"`
|
|
SecretValueHash string `json:"secretValueHash,omitempty"`
|
|
SecretCommentCiphertext string `json:"secretCommentCiphertext,omitempty"`
|
|
SecretCommentIV string `json:"secretCommentIV,omitempty"`
|
|
SecretCommentTag string `json:"secretCommentTag,omitempty"`
|
|
SecretCommentHash string `json:"secretCommentHash,omitempty"`
|
|
Type string `json:"type,omitempty"`
|
|
ID string `json:"id,omitempty"`
|
|
PlainTextKey string `json:"plainTextKey"`
|
|
}
|
|
|
|
type Project struct {
|
|
ID string `json:"id"`
|
|
Name string `json:"name"`
|
|
Slug string `json:"slug"`
|
|
}
|
|
|
|
type RawSecret struct {
|
|
SecretKey string `json:"secretKey,omitempty"`
|
|
SecretValue string `json:"secretValue,omitempty"`
|
|
Type string `json:"type,omitempty"`
|
|
SecretComment string `json:"secretComment,omitempty"`
|
|
ID string `json:"id,omitempty"`
|
|
}
|
|
|
|
type GetEncryptedWorkspaceKeyRequest struct {
|
|
WorkspaceId string `json:"workspaceId"`
|
|
}
|
|
|
|
type GetEncryptedWorkspaceKeyResponse struct {
|
|
ID string `json:"_id"`
|
|
EncryptedKey string `json:"encryptedKey"`
|
|
Nonce string `json:"nonce"`
|
|
Sender struct {
|
|
ID string `json:"_id"`
|
|
Email string `json:"email"`
|
|
RefreshVersion int `json:"refreshVersion"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
V int `json:"__v"`
|
|
FirstName string `json:"firstName"`
|
|
LastName string `json:"lastName"`
|
|
PublicKey string `json:"publicKey"`
|
|
} `json:"sender"`
|
|
Receiver string `json:"receiver"`
|
|
Workspace string `json:"workspace"`
|
|
V int `json:"__v"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
}
|
|
|
|
type GetSecretsByWorkspaceIdAndEnvironmentRequest struct {
|
|
EnvironmentName string `json:"environmentName"`
|
|
WorkspaceId string `json:"workspaceId"`
|
|
}
|
|
|
|
type GetServiceTokenDetailsResponse struct {
|
|
ID string `json:"_id"`
|
|
Name string `json:"name"`
|
|
Workspace string `json:"workspace"`
|
|
ExpiresAt time.Time `json:"expiresAt"`
|
|
EncryptedKey string `json:"encryptedKey"`
|
|
Iv string `json:"iv"`
|
|
Tag string `json:"tag"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
Scopes []struct {
|
|
Environment string `json:"environment"`
|
|
SecretPath string `json:"secretPath"`
|
|
} `json:"scopes"`
|
|
}
|
|
|
|
type GetAccessibleEnvironmentsRequest struct {
|
|
WorkspaceId string `json:"workspaceId"`
|
|
}
|
|
|
|
type GetAccessibleEnvironmentsResponse struct {
|
|
AccessibleEnvironments []struct {
|
|
Name string `json:"name"`
|
|
Slug string `json:"slug"`
|
|
IsWriteDenied bool `json:"isWriteDenied"`
|
|
} `json:"accessibleEnvironments"`
|
|
}
|
|
|
|
type GetLoginOneV2Request struct {
|
|
Email string `json:"email"`
|
|
ClientPublicKey string `json:"clientPublicKey"`
|
|
}
|
|
|
|
type GetLoginOneV2Response struct {
|
|
ServerPublicKey string `json:"serverPublicKey"`
|
|
Salt string `json:"salt"`
|
|
}
|
|
|
|
type GetLoginTwoV2Request struct {
|
|
Email string `json:"email"`
|
|
ClientProof string `json:"clientProof"`
|
|
Password string `json:"password"`
|
|
}
|
|
|
|
type GetLoginTwoV2Response struct {
|
|
MfaEnabled bool `json:"mfaEnabled"`
|
|
EncryptionVersion int `json:"encryptionVersion"`
|
|
Token string `json:"token"`
|
|
PublicKey string `json:"publicKey"`
|
|
EncryptedPrivateKey string `json:"encryptedPrivateKey"`
|
|
Iv string `json:"iv"`
|
|
Tag string `json:"tag"`
|
|
ProtectedKey string `json:"protectedKey"`
|
|
ProtectedKeyIV string `json:"protectedKeyIV"`
|
|
ProtectedKeyTag string `json:"protectedKeyTag"`
|
|
RefreshToken string `json:"RefreshToken"`
|
|
}
|
|
|
|
type VerifyMfaTokenRequest struct {
|
|
Email string `json:"email"`
|
|
MFAToken string `json:"mfaToken"`
|
|
MFAMethod string `json:"mfaMethod"`
|
|
}
|
|
|
|
type VerifyMfaTokenResponse struct {
|
|
EncryptionVersion int `json:"encryptionVersion"`
|
|
Token string `json:"token"`
|
|
PublicKey string `json:"publicKey"`
|
|
EncryptedPrivateKey string `json:"encryptedPrivateKey"`
|
|
Iv string `json:"iv"`
|
|
Tag string `json:"tag"`
|
|
ProtectedKey string `json:"protectedKey"`
|
|
ProtectedKeyIV string `json:"protectedKeyIV"`
|
|
ProtectedKeyTag string `json:"protectedKeyTag"`
|
|
RefreshToken string `json:"refreshToken"`
|
|
}
|
|
|
|
type VerifyMfaTokenErrorResponse struct {
|
|
Type string `json:"type"`
|
|
Message string `json:"message"`
|
|
Context struct {
|
|
Code string `json:"code"`
|
|
TriesLeft int `json:"triesLeft"`
|
|
} `json:"context"`
|
|
Level int `json:"level"`
|
|
LevelName string `json:"level_name"`
|
|
StatusCode int `json:"status_code"`
|
|
DatetimeIso time.Time `json:"datetime_iso"`
|
|
Application string `json:"application"`
|
|
Extra []interface{} `json:"extra"`
|
|
}
|
|
|
|
type GetNewAccessTokenWithRefreshTokenResponse struct {
|
|
Token string `json:"token"`
|
|
}
|
|
|
|
type GetEncryptedSecretsV3Request struct {
|
|
Environment string `json:"environment"`
|
|
WorkspaceId string `json:"workspaceId"`
|
|
SecretPath string `json:"secretPath"`
|
|
IncludeImport bool `json:"include_imports"`
|
|
Recursive bool `json:"recursive"`
|
|
}
|
|
|
|
type GetFoldersV1Request struct {
|
|
Environment string `json:"environment"`
|
|
WorkspaceId string `json:"workspaceId"`
|
|
FoldersPath string `json:"foldersPath"`
|
|
}
|
|
|
|
type GetFoldersV1Response struct {
|
|
Folders []struct {
|
|
ID string `json:"id"`
|
|
Name string `json:"name"`
|
|
} `json:"folders"`
|
|
}
|
|
|
|
type CreateFolderV1Request struct {
|
|
FolderName string `json:"name"`
|
|
WorkspaceId string `json:"workspaceId"`
|
|
Environment string `json:"environment"`
|
|
Path string `json:"path"`
|
|
}
|
|
|
|
type CreateFolderV1Response struct {
|
|
Folder struct {
|
|
ID string `json:"id"`
|
|
Name string `json:"name"`
|
|
} `json:"folder"`
|
|
}
|
|
|
|
type DeleteFolderV1Request struct {
|
|
FolderName string `json:"folderName"`
|
|
WorkspaceId string `json:"workspaceId"`
|
|
Environment string `json:"environment"`
|
|
Directory string `json:"directory"`
|
|
}
|
|
|
|
type DeleteFolderV1Response struct {
|
|
Folders []struct {
|
|
ID string `json:"id"`
|
|
Name string `json:"name"`
|
|
} `json:"folders"`
|
|
}
|
|
|
|
type EncryptedSecretV3 struct {
|
|
ID string `json:"_id"`
|
|
Version int `json:"version"`
|
|
Workspace string `json:"workspace"`
|
|
Type string `json:"type"`
|
|
Tags []struct {
|
|
ID string `json:"_id"`
|
|
Name string `json:"name"`
|
|
Slug string `json:"slug"`
|
|
Workspace string `json:"workspace"`
|
|
} `json:"tags"`
|
|
Environment string `json:"environment"`
|
|
SecretKeyCiphertext string `json:"secretKeyCiphertext"`
|
|
SecretKeyIV string `json:"secretKeyIV"`
|
|
SecretKeyTag string `json:"secretKeyTag"`
|
|
SecretValueCiphertext string `json:"secretValueCiphertext"`
|
|
SecretValueIV string `json:"secretValueIV"`
|
|
SecretValueTag string `json:"secretValueTag"`
|
|
SecretCommentCiphertext string `json:"secretCommentCiphertext"`
|
|
SecretCommentIV string `json:"secretCommentIV"`
|
|
SecretCommentTag string `json:"secretCommentTag"`
|
|
Algorithm string `json:"algorithm"`
|
|
KeyEncoding string `json:"keyEncoding"`
|
|
Folder string `json:"folder"`
|
|
V int `json:"__v"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
}
|
|
|
|
type ImportedSecretV3 struct {
|
|
Environment string `json:"environment"`
|
|
FolderId string `json:"folderId"`
|
|
SecretPath string `json:"secretPath"`
|
|
Secrets []EncryptedSecretV3 `json:"secrets"`
|
|
}
|
|
|
|
type ImportedRawSecretV3 struct {
|
|
SecretPath string `json:"secretPath"`
|
|
Environment string `json:"environment"`
|
|
FolderId string `json:"folderId"`
|
|
Secrets []struct {
|
|
ID string `json:"id"`
|
|
Workspace string `json:"workspace"`
|
|
Environment string `json:"environment"`
|
|
Version int `json:"version"`
|
|
Type string `json:"type"`
|
|
SecretKey string `json:"secretKey"`
|
|
SecretValue string `json:"secretValue"`
|
|
SecretComment string `json:"secretComment"`
|
|
} `json:"secrets"`
|
|
}
|
|
|
|
type GetEncryptedSecretsV3Response struct {
|
|
Secrets []EncryptedSecretV3 `json:"secrets"`
|
|
ImportedSecrets []ImportedSecretV3 `json:"imports,omitempty"`
|
|
}
|
|
|
|
type CreateSecretV3Request struct {
|
|
SecretName string `json:"secretName"`
|
|
WorkspaceID string `json:"workspaceId"`
|
|
Type string `json:"type"`
|
|
Environment string `json:"environment"`
|
|
SecretKeyCiphertext string `json:"secretKeyCiphertext"`
|
|
SecretKeyIV string `json:"secretKeyIV"`
|
|
SecretKeyTag string `json:"secretKeyTag"`
|
|
SecretValueCiphertext string `json:"secretValueCiphertext"`
|
|
SecretValueIV string `json:"secretValueIV"`
|
|
SecretValueTag string `json:"secretValueTag"`
|
|
SecretCommentCiphertext string `json:"secretCommentCiphertext"`
|
|
SecretCommentIV string `json:"secretCommentIV"`
|
|
SecretCommentTag string `json:"secretCommentTag"`
|
|
SecretPath string `json:"secretPath"`
|
|
}
|
|
|
|
type CreateRawSecretV3Request struct {
|
|
SecretName string `json:"-"`
|
|
WorkspaceID string `json:"workspaceId"`
|
|
Type string `json:"type,omitempty"`
|
|
Environment string `json:"environment"`
|
|
SecretPath string `json:"secretPath,omitempty"`
|
|
SecretValue string `json:"secretValue"`
|
|
SecretComment string `json:"secretComment,omitempty"`
|
|
SkipMultilineEncoding bool `json:"skipMultilineEncoding,omitempty"`
|
|
}
|
|
|
|
type DeleteSecretV3Request struct {
|
|
SecretName string `json:"secretName"`
|
|
WorkspaceId string `json:"workspaceId"`
|
|
Environment string `json:"environment"`
|
|
Type string `json:"type,omitempty"`
|
|
SecretPath string `json:"secretPath,omitempty"`
|
|
}
|
|
|
|
type UpdateSecretByNameV3Request struct {
|
|
WorkspaceID string `json:"workspaceId"`
|
|
Environment string `json:"environment"`
|
|
Type string `json:"type"`
|
|
SecretPath string `json:"secretPath"`
|
|
SecretValueCiphertext string `json:"secretValueCiphertext"`
|
|
SecretValueIV string `json:"secretValueIV"`
|
|
SecretValueTag string `json:"secretValueTag"`
|
|
}
|
|
|
|
type UpdateRawSecretByNameV3Request struct {
|
|
SecretName string `json:"-"`
|
|
WorkspaceID string `json:"workspaceId"`
|
|
Environment string `json:"environment"`
|
|
SecretPath string `json:"secretPath,omitempty"`
|
|
SecretValue string `json:"secretValue"`
|
|
Type string `json:"type,omitempty"`
|
|
}
|
|
|
|
type GetSingleSecretByNameV3Request struct {
|
|
SecretName string `json:"secretName"`
|
|
WorkspaceId string `json:"workspaceId"`
|
|
Environment string `json:"environment"`
|
|
Type string `json:"type"`
|
|
SecretPath string `json:"secretPath"`
|
|
}
|
|
|
|
type GetSingleSecretByNameSecretResponse struct {
|
|
Secrets []struct {
|
|
ID string `json:"_id"`
|
|
Version int `json:"version"`
|
|
Workspace string `json:"workspace"`
|
|
Type string `json:"type"`
|
|
Environment string `json:"environment"`
|
|
SecretKeyCiphertext string `json:"secretKeyCiphertext"`
|
|
SecretKeyIV string `json:"secretKeyIV"`
|
|
SecretKeyTag string `json:"secretKeyTag"`
|
|
SecretValueCiphertext string `json:"secretValueCiphertext"`
|
|
SecretValueIV string `json:"secretValueIV"`
|
|
SecretValueTag string `json:"secretValueTag"`
|
|
SecretCommentCiphertext string `json:"secretCommentCiphertext"`
|
|
SecretCommentIV string `json:"secretCommentIV"`
|
|
SecretCommentTag string `json:"secretCommentTag"`
|
|
Algorithm string `json:"algorithm"`
|
|
KeyEncoding string `json:"keyEncoding"`
|
|
Folder string `json:"folder"`
|
|
V int `json:"__v"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
} `json:"secrets"`
|
|
}
|
|
|
|
type ScopePermission struct {
|
|
Environment string `json:"environment"`
|
|
SecretPath string `json:"secretPath"`
|
|
}
|
|
|
|
type CreateServiceTokenRequest struct {
|
|
Name string `json:"name"`
|
|
WorkspaceId string `json:"workspaceId"`
|
|
Scopes []ScopePermission `json:"scopes"`
|
|
ExpiresIn int `json:"expiresIn"`
|
|
EncryptedKey string `json:"encryptedKey"`
|
|
Iv string `json:"iv"`
|
|
Tag string `json:"tag"`
|
|
RandomBytes string `json:"randomBytes"`
|
|
Permissions []string `json:"permissions"`
|
|
}
|
|
|
|
type ServiceTokenData struct {
|
|
ID string `json:"_id"`
|
|
Name string `json:"name"`
|
|
Workspace string `json:"workspace"`
|
|
Scopes []interface{} `json:"scopes"`
|
|
User string `json:"user"`
|
|
LastUsed time.Time `json:"lastUsed"`
|
|
Permissions []string `json:"permissions"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
}
|
|
|
|
type CreateServiceTokenResponse struct {
|
|
ServiceToken string `json:"serviceToken"`
|
|
ServiceTokenData ServiceTokenData `json:"serviceTokenData"`
|
|
}
|
|
|
|
type UniversalAuthLoginRequest struct {
|
|
ClientSecret string `json:"clientSecret"`
|
|
ClientId string `json:"clientId"`
|
|
}
|
|
|
|
type UniversalAuthLoginResponse struct {
|
|
AccessToken string `json:"accessToken"`
|
|
AccessTokenTTL int `json:"expiresIn"`
|
|
TokenType string `json:"tokenType"`
|
|
AccessTokenMaxTTL int `json:"accessTokenMaxTTL"`
|
|
}
|
|
|
|
type UniversalAuthRefreshRequest struct {
|
|
AccessToken string `json:"accessToken"`
|
|
}
|
|
|
|
type UniversalAuthRefreshResponse struct {
|
|
AccessToken string `json:"accessToken"`
|
|
AccessTokenTTL int `json:"expiresIn"`
|
|
TokenType string `json:"tokenType"`
|
|
AccessTokenMaxTTL int `json:"accessTokenMaxTTL"`
|
|
}
|
|
|
|
type CreateDynamicSecretLeaseV1Request struct {
|
|
Environment string `json:"environmentSlug"`
|
|
ProjectSlug string `json:"projectSlug"`
|
|
SecretPath string `json:"secretPath,omitempty"`
|
|
DynamicSecretName string `json:"dynamicSecretName"`
|
|
TTL string `json:"ttl,omitempty"`
|
|
}
|
|
|
|
type CreateDynamicSecretLeaseV1Response struct {
|
|
Lease struct {
|
|
Id string `json:"id"`
|
|
ExpireAt time.Time `json:"expireAt"`
|
|
} `json:"lease"`
|
|
DynamicSecret struct {
|
|
Id string `json:"id"`
|
|
DefaultTTL string `json:"defaultTTL"`
|
|
MaxTTL string `json:"maxTTL"`
|
|
Type string `json:"type"`
|
|
} `json:"dynamicSecret"`
|
|
Data map[string]interface{} `json:"data"`
|
|
}
|
|
|
|
type GetDynamicSecretLeaseV1Request struct {
|
|
LeaseID string
|
|
Environment string
|
|
ProjectSlug string
|
|
SecretPath string
|
|
}
|
|
|
|
type GetDynamicSecretLeaseV1Response struct {
|
|
Lease struct {
|
|
Id string `json:"id"`
|
|
ExpireAt time.Time `json:"expireAt"`
|
|
} `json:"lease"`
|
|
DynamicSecret models.DynamicSecret `json:"dynamicSecret"`
|
|
}
|
|
|
|
type GetLoginV3Request struct {
|
|
Email string `json:"email"`
|
|
Password string `json:"password"`
|
|
}
|
|
|
|
type GetLoginV3Response struct {
|
|
AccessToken string `json:"accessToken"`
|
|
}
|
|
|
|
type GetRawSecretsV3Request struct {
|
|
Environment string `json:"environment"`
|
|
WorkspaceId string `json:"workspaceId"`
|
|
SecretPath string `json:"secretPath"`
|
|
IncludeImport bool `json:"include_imports"`
|
|
Recursive bool `json:"recursive"`
|
|
TagSlugs string `json:"tagSlugs,omitempty"`
|
|
ExpandSecretReferences bool `json:"expandSecretReferences,omitempty"`
|
|
}
|
|
|
|
type GetRawSecretsV3Response struct {
|
|
Secrets []struct {
|
|
ID string `json:"_id"`
|
|
Version int `json:"version"`
|
|
Workspace string `json:"workspace"`
|
|
Type string `json:"type"`
|
|
Environment string `json:"environment"`
|
|
SecretKey string `json:"secretKey"`
|
|
SecretValue string `json:"secretValue"`
|
|
SecretComment string `json:"secretComment"`
|
|
SecretPath string `json:"secretPath"`
|
|
SkipMultilineEncoding bool `json:"skipMultilineEncoding"`
|
|
Tags []models.Tag `json:"tags"`
|
|
} `json:"secrets"`
|
|
Imports []ImportedRawSecretV3 `json:"imports"`
|
|
ETag string
|
|
}
|
|
|
|
type GetRawSecretV3ByNameRequest struct {
|
|
SecretName string `json:"secretName"`
|
|
WorkspaceID string `json:"workspaceId"`
|
|
Type string `json:"type,omitempty"`
|
|
Environment string `json:"environment"`
|
|
SecretPath string `json:"secretPath,omitempty"`
|
|
}
|
|
|
|
type GetRawSecretV3ByNameResponse struct {
|
|
Secret struct {
|
|
ID string `json:"_id"`
|
|
Version int `json:"version"`
|
|
Workspace string `json:"workspace"`
|
|
Type string `json:"type"`
|
|
Environment string `json:"environment"`
|
|
SecretKey string `json:"secretKey"`
|
|
SecretValue string `json:"secretValue"`
|
|
SecretComment string `json:"secretComment"`
|
|
SecretPath string `json:"secretPath"`
|
|
SkipMultilineEncoding bool `json:"skipMultilineEncoding"`
|
|
} `json:"secret"`
|
|
ETag string
|
|
}
|
|
|
|
type GetRelayCredentialsResponseV1 struct {
|
|
TurnServerUsername string `json:"turnServerUsername"`
|
|
TurnServerPassword string `json:"turnServerPassword"`
|
|
TurnServerRealm string `json:"turnServerRealm"`
|
|
TurnServerAddress string `json:"turnServerAddress"`
|
|
KMSStaticIp string `json:"kmsStaticIp"`
|
|
}
|
|
|
|
type ExchangeRelayCertRequestV1 struct {
|
|
RelayAddress string `json:"relayAddress"`
|
|
}
|
|
|
|
type ExchangeRelayCertResponseV1 struct {
|
|
SerialNumber string `json:"serialNumber"`
|
|
PrivateKey string `json:"privateKey"`
|
|
Certificate string `json:"certificate"`
|
|
CertificateChain string `json:"certificateChain"`
|
|
}
|
|
|
|
type BootstrapInstanceRequest struct {
|
|
Email string `json:"email"`
|
|
Password string `json:"password"`
|
|
Organization string `json:"organization"`
|
|
Domain string `json:"domain"`
|
|
}
|
|
|
|
type BootstrapInstanceResponse struct {
|
|
Message string `json:"message"`
|
|
Identity BootstrapIdentity `json:"identity"`
|
|
Organization BootstrapOrganization `json:"organization"`
|
|
User BootstrapUser `json:"user"`
|
|
}
|
|
|
|
type BootstrapIdentity struct {
|
|
ID string `json:"id"`
|
|
Name string `json:"name"`
|
|
Credentials BootstrapIdentityCredentials `json:"credentials"`
|
|
}
|
|
|
|
type BootstrapIdentityCredentials struct {
|
|
Token string `json:"token"`
|
|
}
|
|
|
|
type BootstrapOrganization struct {
|
|
ID string `json:"id"`
|
|
Name string `json:"name"`
|
|
Slug string `json:"slug"`
|
|
}
|
|
|
|
type BootstrapUser struct {
|
|
ID string `json:"id"`
|
|
Email string `json:"email"`
|
|
FirstName string `json:"firstName"`
|
|
LastName string `json:"lastName"`
|
|
Username string `json:"username"`
|
|
SuperAdmin bool `json:"superAdmin"`
|
|
}
|
|
|
|
type RegisterRelayRequest struct {
|
|
Host string `json:"host"`
|
|
Name string `json:"name"`
|
|
}
|
|
|
|
type RegisterRelayResponse struct {
|
|
PKI struct {
|
|
ServerCertificate string `json:"serverCertificate"`
|
|
ServerPrivateKey string `json:"serverPrivateKey"`
|
|
ClientCertificateChain string `json:"clientCertificateChain"`
|
|
} `json:"pki"`
|
|
SSH struct {
|
|
ServerCertificate string `json:"serverCertificate"`
|
|
ServerPrivateKey string `json:"serverPrivateKey"`
|
|
ClientCAPublicKey string `json:"clientCAPublicKey"`
|
|
} `json:"ssh"`
|
|
}
|
|
|
|
type Relay struct {
|
|
ID string `json:"id"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
OrgId *string `json:"orgId"`
|
|
IdentityId *string `json:"identityId"`
|
|
Name string `json:"name"`
|
|
Host string `json:"host"`
|
|
Heartbeat time.Time `json:"heartbeat"`
|
|
HealthAlertedAt time.Time `json:"healthAlertedAt"`
|
|
}
|
|
|
|
type GetRelaysResponse []Relay
|
|
|
|
type RegisterGatewayRequest struct {
|
|
RelayName string `json:"relayName"`
|
|
Name string `json:"name"`
|
|
}
|
|
|
|
type RegisterGatewayResponse struct {
|
|
GatewayID string `json:"gatewayId"`
|
|
RelayHost string `json:"relayHost"`
|
|
PKI struct {
|
|
ServerCertificate string `json:"serverCertificate"`
|
|
ServerPrivateKey string `json:"serverPrivateKey"`
|
|
ClientCertificateChain string `json:"clientCertificateChain"`
|
|
} `json:"pki"`
|
|
SSH struct {
|
|
ClientCertificate string `json:"clientCertificate"`
|
|
ClientPrivateKey string `json:"clientPrivateKey"`
|
|
ServerCAPublicKey string `json:"serverCAPublicKey"`
|
|
} `json:"ssh"`
|
|
}
|
|
|
|
type PAMAccessRequest struct {
|
|
Duration string `json:"duration,omitempty"`
|
|
ResourceName string `json:"resourceName,omitempty"`
|
|
AccountName string `json:"accountName,omitempty"`
|
|
ProjectId string `json:"projectId,omitempty"`
|
|
MfaSessionId string `json:"mfaSessionId,omitempty"`
|
|
}
|
|
|
|
type PAMAccessResponse struct {
|
|
SessionId string `json:"sessionId"`
|
|
ResourceType string `json:"resourceType"`
|
|
RelayClientCertificate string `json:"relayClientCertificate"`
|
|
RelayClientPrivateKey string `json:"relayClientPrivateKey"`
|
|
RelayServerCertificateChain string `json:"relayServerCertificateChain"`
|
|
GatewayClientCertificate string `json:"gatewayClientCertificate"`
|
|
GatewayClientPrivateKey string `json:"gatewayClientPrivateKey"`
|
|
GatewayServerCertificateChain string `json:"gatewayServerCertificateChain"`
|
|
RelayHost string `json:"relayHost"`
|
|
Metadata map[string]string `json:"metadata,omitempty"`
|
|
}
|
|
|
|
type PAMAccessApprovalRequestPayloadRequestData struct {
|
|
ResourceName string `json:"resourceName,omitempty"`
|
|
AccountName string `json:"accountName,omitempty"`
|
|
AccessDuration string `json:"accessDuration"`
|
|
}
|
|
|
|
type PAMAccessApprovalRequest struct {
|
|
ProjectId string `json:"projectId"`
|
|
RequestData PAMAccessApprovalRequestPayloadRequestData `json:"requestData"`
|
|
}
|
|
|
|
type PAMAccessApprovalRequestResponse struct {
|
|
Request struct {
|
|
ID string `json:"id"`
|
|
ProjectId string `json:"projectId"`
|
|
OrgId string `json:"organizationId"`
|
|
} `json:"request"`
|
|
}
|
|
|
|
type PAMSessionCredentialsResponse struct {
|
|
Credentials PAMSessionCredentials `json:"credentials"`
|
|
}
|
|
|
|
type PAMSessionCredentials struct {
|
|
Host string `json:"host"`
|
|
Port int `json:"port"`
|
|
Database string `json:"database"`
|
|
SSLEnabled bool `json:"sslEnabled"`
|
|
SSLRejectUnauthorized bool `json:"sslRejectUnauthorized"`
|
|
SSLCertificate string `json:"sslCertificate,omitempty"`
|
|
Username string `json:"username"`
|
|
Password string `json:"password"`
|
|
AuthMethod string `json:"authMethod,omitempty"`
|
|
PrivateKey string `json:"privateKey,omitempty"`
|
|
Certificate string `json:"certificate,omitempty"`
|
|
Url string `json:"url,omitempty"`
|
|
ServiceAccountToken string `json:"serviceAccountToken,omitempty"`
|
|
}
|
|
|
|
type MFASessionStatus string
|
|
|
|
const (
|
|
MFASessionStatusPending MFASessionStatus = "PENDING"
|
|
MFASessionStatusActive MFASessionStatus = "ACTIVE"
|
|
)
|
|
|
|
type MFASessionStatusResponse struct {
|
|
Status MFASessionStatus `json:"status"`
|
|
MfaMethod string `json:"mfaMethod"`
|
|
}
|
|
|
|
type UploadSessionLogEntry struct {
|
|
Timestamp time.Time `json:"timestamp"`
|
|
Input string `json:"input"`
|
|
Output string `json:"output"`
|
|
}
|
|
|
|
// UploadTerminalEvent represents a terminal session event for upload
|
|
type UploadTerminalEvent struct {
|
|
Timestamp time.Time `json:"timestamp"`
|
|
EventType string `json:"eventType"`
|
|
Data []byte `json:"data"`
|
|
ElapsedTime float64 `json:"elapsedTime"`
|
|
}
|
|
|
|
type UploadHttpEvent struct {
|
|
Timestamp time.Time `json:"timestamp"`
|
|
EventType string `json:"eventType"`
|
|
RequestId string `json:"requestId"`
|
|
Method string `json:"method,omitempty"`
|
|
Url string `json:"url,omitempty"`
|
|
Status string `json:"status,omitempty"`
|
|
Headers map[string][]string `json:"headers,omitempty"`
|
|
Body []byte `json:"body,omitempty"`
|
|
}
|
|
|
|
type UploadPAMSessionLogsRequest struct {
|
|
Logs interface{} `json:"logs"` // Can be []UploadSessionLogEntry or []UploadTerminalEvent
|
|
}
|
|
|
|
type RelayHeartbeatRequest struct {
|
|
Name string `json:"name"`
|
|
}
|
|
|
|
type AltName struct {
|
|
Type string `json:"type"`
|
|
Value string `json:"value"`
|
|
}
|
|
|
|
type CertificateAttributes struct {
|
|
TTL string `json:"ttl,omitempty"`
|
|
SignatureAlgorithm string `json:"signatureAlgorithm,omitempty"`
|
|
KeyAlgorithm string `json:"keyAlgorithm,omitempty"`
|
|
CommonName string `json:"commonName,omitempty"`
|
|
KeyUsages []string `json:"keyUsages,omitempty"`
|
|
ExtendedKeyUsages []string `json:"extendedKeyUsages,omitempty"`
|
|
NotBefore string `json:"notBefore,omitempty"`
|
|
NotAfter string `json:"notAfter,omitempty"`
|
|
AltNames []AltName `json:"altNames,omitempty"`
|
|
RemoveRootsFromChain bool `json:"removeRootsFromChain,omitempty"`
|
|
}
|
|
|
|
type IssueCertificateRequest struct {
|
|
ProfileID string `json:"profileId"`
|
|
CSR string `json:"csr,omitempty"`
|
|
Attributes *CertificateAttributes `json:"attributes,omitempty"`
|
|
}
|
|
|
|
type CertificateData struct {
|
|
Certificate string `json:"certificate"`
|
|
IssuingCaCertificate string `json:"issuingCaCertificate"`
|
|
CertificateChain string `json:"certificateChain"`
|
|
PrivateKey string `json:"privateKey,omitempty"`
|
|
SerialNumber string `json:"serialNumber"`
|
|
CertificateID string `json:"certificateId"`
|
|
}
|
|
|
|
type CertificateResponse struct {
|
|
Certificate *CertificateData `json:"certificate,omitempty"`
|
|
CertificateRequestID string `json:"certificateRequestId"`
|
|
}
|
|
|
|
type RetrieveCertificateResponse struct {
|
|
Certificate struct {
|
|
ID string `json:"id"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
Status string `json:"status"`
|
|
SerialNumber string `json:"serialNumber"`
|
|
CommonName string `json:"commonName"`
|
|
NotBefore time.Time `json:"notBefore"`
|
|
NotAfter time.Time `json:"notAfter"`
|
|
ProjectId string `json:"projectId"`
|
|
CaId string `json:"caId"`
|
|
KeyUsages []string `json:"keyUsages"`
|
|
ExtendedKeyUsages []string `json:"extendedKeyUsages"`
|
|
Certificate string `json:"certificate,omitempty"`
|
|
CertificateChain string `json:"certificateChain,omitempty"`
|
|
PrivateKey string `json:"privateKey,omitempty"`
|
|
} `json:"certificate"`
|
|
}
|
|
|
|
type RenewCertificateRequest struct {
|
|
RemoveRootsFromChain bool `json:"removeRootsFromChain,omitempty"`
|
|
}
|
|
|
|
type RenewCertificateResponse struct {
|
|
Certificate string `json:"certificate"`
|
|
IssuingCaCertificate string `json:"issuingCaCertificate"`
|
|
CertificateChain string `json:"certificateChain"`
|
|
PrivateKey string `json:"privateKey"`
|
|
SerialNumber string `json:"serialNumber"`
|
|
CertificateID string `json:"certificateId"`
|
|
CertificateRequestID string `json:"certificateRequestId,omitempty"`
|
|
}
|
|
|
|
type GetCertificateRequestResponse struct {
|
|
Status string `json:"status"` // "pending", "issued", "failed"
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
CommonName string `json:"commonName,omitempty"`
|
|
ProjectID string `json:"projectId,omitempty"`
|
|
ProfileID string `json:"profileId,omitempty"`
|
|
Certificate *string `json:"certificate,omitempty"`
|
|
IssuingCaCertificate *string `json:"issuingCaCertificate,omitempty"`
|
|
CertificateChain *string `json:"certificateChain,omitempty"`
|
|
PrivateKey *string `json:"privateKey,omitempty"`
|
|
SerialNumber *string `json:"serialNumber,omitempty"`
|
|
CertificateID *string `json:"certificateId,omitempty"`
|
|
ErrorMessage *string `json:"errorMessage,omitempty"`
|
|
}
|