mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-03 05:25:56 +00:00
Feat: Machine Identity support (types)
This commit is contained in:
@@ -6,7 +6,6 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/Infisical/infisical/k8-operator/api/v1alpha1"
|
"github.com/Infisical/infisical/k8-operator/api/v1alpha1"
|
||||||
"github.com/Infisical/infisical/k8-operator/packages/api"
|
|
||||||
"github.com/Infisical/infisical/k8-operator/packages/model"
|
"github.com/Infisical/infisical/k8-operator/packages/model"
|
||||||
"github.com/Infisical/infisical/k8-operator/packages/util"
|
"github.com/Infisical/infisical/k8-operator/packages/util"
|
||||||
corev1 "k8s.io/api/core/v1"
|
corev1 "k8s.io/api/core/v1"
|
||||||
@@ -303,7 +302,7 @@ func (r *InfisicalSecretReconciler) ReconcileInfisicalSecret(ctx context.Context
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
var plainTextSecretsFromApi []model.SingleEnvironmentVariable
|
var plainTextSecretsFromApi []model.SingleEnvironmentVariable
|
||||||
var updateAttributes api.UpdateAttributes
|
var updateAttributes model.UpdateAttributes
|
||||||
|
|
||||||
if authStrategy == AuthStrategy.SERVICE_ACCOUNT { // Service Account
|
if authStrategy == AuthStrategy.SERVICE_ACCOUNT { // Service Account
|
||||||
plainTextSecretsFromApi, updateAttributes, err = util.GetPlainTextSecretsViaServiceAccount(serviceAccountCreds, infisicalSecret.Spec.Authentication.ServiceAccount.ProjectId, infisicalSecret.Spec.Authentication.ServiceAccount.EnvironmentName, secretVersionBasedOnETag)
|
plainTextSecretsFromApi, updateAttributes, err = util.GetPlainTextSecretsViaServiceAccount(serviceAccountCreds, infisicalSecret.Spec.Authentication.ServiceAccount.ProjectId, infisicalSecret.Spec.Authentication.ServiceAccount.EnvironmentName, secretVersionBasedOnETag)
|
||||||
|
|||||||
@@ -65,6 +65,17 @@ type EncryptedSecretV3 struct {
|
|||||||
UpdatedAt time.Time `json:"updatedAt"`
|
UpdatedAt time.Time `json:"updatedAt"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type DecryptedSecretV3 struct {
|
||||||
|
ID string `json:"id"`
|
||||||
|
Workspace string `json:"workspace"`
|
||||||
|
Environment string `json:"environment"`
|
||||||
|
Version int `json:"version"`
|
||||||
|
Type string `json:"string"`
|
||||||
|
SecretKey string `json:"secretKey"`
|
||||||
|
SecretValue string `json:"secretValue"`
|
||||||
|
SecretComment string `json:"secretComment"`
|
||||||
|
}
|
||||||
|
|
||||||
type ImportedSecretV3 struct {
|
type ImportedSecretV3 struct {
|
||||||
Environment string `json:"environment"`
|
Environment string `json:"environment"`
|
||||||
FolderId string `json:"folderId"`
|
FolderId string `json:"folderId"`
|
||||||
@@ -79,6 +90,19 @@ type GetEncryptedSecretsV3Response struct {
|
|||||||
ETag string `json:"ETag,omitempty"`
|
ETag string `json:"ETag,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type GetDecryptedSecretsV3Response struct {
|
||||||
|
Secrets []DecryptedSecretV3 `json:"secrets"`
|
||||||
|
ETag string `json:"ETag,omitempty"`
|
||||||
|
Modified bool `json:"modified,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type GetDecryptedSecretsV3Request struct {
|
||||||
|
ProjectID string `json:"projectId"`
|
||||||
|
Environment string `json:"environment"`
|
||||||
|
SecretPath string `json:"secretPath"`
|
||||||
|
ETag string `json:"etag,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
type GetServiceTokenDetailsResponse struct {
|
type GetServiceTokenDetailsResponse struct {
|
||||||
ID string `json:"_id"`
|
ID string `json:"_id"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
@@ -101,6 +125,13 @@ type ServiceAccountDetailsResponse struct {
|
|||||||
} `json:"serviceAccount"`
|
} `json:"serviceAccount"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type MachineIdentityDetailsResponse struct {
|
||||||
|
AccessToken string `json:"accessToken"`
|
||||||
|
ExpiresIn int `json:"expiresIn"`
|
||||||
|
AccessTokenMaxTTL int `json:"accessTokenMaxTTL"`
|
||||||
|
TokenType string `json:"tokenType"`
|
||||||
|
}
|
||||||
|
|
||||||
type ServiceAccountWorkspacePermission struct {
|
type ServiceAccountWorkspacePermission struct {
|
||||||
ID string `json:"_id"`
|
ID string `json:"_id"`
|
||||||
ServiceAccount string `json:"serviceAccount"`
|
ServiceAccount string `json:"serviceAccount"`
|
||||||
@@ -128,6 +159,15 @@ type GetServiceAccountKeysRequest struct {
|
|||||||
ServiceAccountId string `json:"id"`
|
ServiceAccountId string `json:"id"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type MachineIdentityUniversalAuthLoginRequest struct {
|
||||||
|
ClientId string `json:"clientId"`
|
||||||
|
ClientSecret string `json:"clientSecret"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type MachineIdentityUniversalAuthRefreshRequest struct {
|
||||||
|
AccessToken string `json:"accessToken"`
|
||||||
|
}
|
||||||
|
|
||||||
type ServiceAccountKey struct {
|
type ServiceAccountKey struct {
|
||||||
ID string `json:"_id"`
|
ID string `json:"_id"`
|
||||||
EncryptedKey string `json:"encryptedKey"`
|
EncryptedKey string `json:"encryptedKey"`
|
||||||
|
|||||||
Reference in New Issue
Block a user