Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

Fix merge conflicts

Tuan Dangce66cccd8bfe
diff --cc backend/src/@types/fastify.d.ts
index faeb89c4f2,4776e26dc6..aa9a20ff88
--- a/backend/src/@types/fastify.d.ts
+++ b/backend/src/@types/fastify.d.ts
@@@ -33,8 -33,8 +33,9 @@@ import { TGroupProjectServiceFactory }
import { TIdentityServiceFactory } from "@app/services/identity/identity-service";
import { TIdentityAccessTokenServiceFactory } from "@app/services/identity-access-token/identity-access-token-service";
import { TIdentityAwsAuthServiceFactory } from "@app/services/identity-aws-auth/identity-aws-auth-service";
+import { TIdentityAzureAuthServiceFactory } from "@app/services/identity-azure-auth/identity-azure-auth-service";
import { TIdentityGcpAuthServiceFactory } from "@app/services/identity-gcp-auth/identity-gcp-auth-service";
+ import { TIdentityKubernetesAuthServiceFactory } from "@app/services/identity-kubernetes-auth/identity-kubernetes-auth-service";
import { TIdentityProjectServiceFactory } from "@app/services/identity-project/identity-project-service";
import { TIdentityUaServiceFactory } from "@app/services/identity-ua/identity-ua-service";
import { TIntegrationServiceFactory } from "@app/services/integration/integration-service";
@@@ -118,9 -118,9 +119,10 @@@ declare module "fastify"
identityAccessToken: TIdentityAccessTokenServiceFactory;
identityProject: TIdentityProjectServiceFactory;
identityUa: TIdentityUaServiceFactory;
+ identityKubernetesAuth: TIdentityKubernetesAuthServiceFactory;
identityGcpAuth: TIdentityGcpAuthServiceFactory;
identityAwsAuth: TIdentityAwsAuthServiceFactory;
+ identityAzureAuth: TIdentityAzureAuthServiceFactory;
accessApprovalPolicy: TAccessApprovalPolicyServiceFactory;
accessApprovalRequest: TAccessApprovalRequestServiceFactory;
secretApprovalPolicy: TSecretApprovalPolicyServiceFactory;
diff --cc backend/src/db/schemas/index.ts
index 917f5c1ea2,cffa4f4921..b4d2455798
--- a/backend/src/db/schemas/index.ts
+++ b/backend/src/db/schemas/index.ts
@@@ -18,8 -18,8 +18,9 @@@ export * from "./groups"
export * from "./identities";
export * from "./identity-access-tokens";
export * from "./identity-aws-auths";
+export * from "./identity-azure-auths";
export * from "./identity-gcp-auths";
+ export * from "./identity-kubernetes-auths";
export * from "./identity-org-memberships";
export * from "./identity-project-additional-privilege";
export * from "./identity-project-membership-role";
diff --cc backend/src/db/schemas/models.ts
index e4c6f6a91b,28a6973b7a..b23c9e9ca7
--- a/backend/src/db/schemas/models.ts
+++ b/backend/src/db/schemas/models.ts
@@@ -45,8 -45,8 +45,9 @@@ export enum TableName
Identity = "identities",
IdentityAccessToken = "identity_access_tokens",
IdentityUniversalAuth = "identity_universal_auths",
+ IdentityKubernetesAuth = "identity_kubernetes_auths",
IdentityGcpAuth = "identity_gcp_auths",
+ IdentityAzureAuth = "identity_azure_auths",
IdentityUaClientSecret = "identity_ua_client_secrets",
IdentityAwsAuth = "identity_aws_auths",
IdentityOrgMembership = "identity_org_memberships",
@@@ -147,7 -147,7 +148,8 @@@ export enum ProjectUpgradeStatus
export enum IdentityAuthMethod {
Univeral = "universal-auth",
+ KUBERNETES_AUTH = "kubernetes-auth",
GCP_AUTH = "gcp-auth",
- AWS_AUTH = "aws-auth"
+ AWS_AUTH = "aws-auth",
+ AZURE_AUTH = "azure-auth"
}
diff --cc backend/src/server/routes/index.ts
index ebc572a57f,75c43a9aa9..13d9f8dcc1
--- a/backend/src/server/routes/index.ts
+++ b/backend/src/server/routes/index.ts
@@@ -80,10 -80,10 +80,12 @@@ import { identityAccessTokenDALFactory
import { identityAccessTokenServiceFactory } from "@app/services/identity-access-token/identity-access-token-service";
import { identityAwsAuthDALFactory } from "@app/services/identity-aws-auth/identity-aws-auth-dal";
import { identityAwsAuthServiceFactory } from "@app/services/identity-aws-auth/identity-aws-auth-service";
+import { identityAzureAuthDALFactory } from "@app/services/identity-azure-auth/identity-azure-auth-dal";
+import { identityAzureAuthServiceFactory } from "@app/services/identity-azure-auth/identity-azure-auth-service";
import { identityGcpAuthDALFactory } from "@app/services/identity-gcp-auth/identity-gcp-auth-dal";
import { identityGcpAuthServiceFactory } from "@app/services/identity-gcp-auth/identity-gcp-auth-service";
+ import { identityKubernetesAuthDALFactory } from "@app/services/identity-kubernetes-auth/identity-kubernetes-auth-dal";
+ import { identityKubernetesAuthServiceFactory } from "@app/services/identity-kubernetes-auth/identity-kubernetes-auth-service";
import { identityProjectDALFactory } from "@app/services/identity-project/identity-project-dal";
import { identityProjectMembershipRoleDALFactory } from "@app/services/identity-project/identity-project-membership-role-dal";
import { identityProjectServiceFactory } from "@app/services/identity-project/identity-project-service";
@@@ -209,10 -209,11 +211,11 @@@ export const registerRoutes = async
const identityProjectAdditionalPrivilegeDAL = identityProjectAdditionalPrivilegeDALFactory(db);
const identityUaDAL = identityUaDALFactory(db);
+ const identityKubernetesAuthDAL = identityKubernetesAuthDALFactory(db);
const identityUaClientSecretDAL = identityUaClientSecretDALFactory(db);
const identityAwsAuthDAL = identityAwsAuthDALFactory(db);
-
const identityGcpAuthDAL = identityGcpAuthDALFactory(db);
+ const identityAzureAuthDAL = identityAzureAuthDALFactory(db);
const auditLogDAL = auditLogDALFactory(db);
const auditLogStreamDAL = auditLogStreamDALFactory(db);
@@@ -809,9 -810,9 +821,10 @@@
identityAccessToken: identityAccessTokenService,
identityProject: identityProjectService,
identityUa: identityUaService,
+ identityKubernetesAuth: identityKubernetesAuthService,
identityGcpAuth: identityGcpAuthService,
identityAwsAuth: identityAwsAuthService,
+ identityAzureAuth: identityAzureAuthService,
secretApprovalPolicy: sapService,
accessApprovalPolicy: accessApprovalPolicyService,
accessApprovalRequest: accessApprovalRequestService,
diff --cc backend/src/server/routes/v1/index.ts
index 1302a9469d,262e3cb201..2744fc153a
--- a/backend/src/server/routes/v1/index.ts
+++ b/backend/src/server/routes/v1/index.ts
@@@ -3,8 -3,8 +3,9 @@@ import { registerAuthRoutes } from "./a
import { registerProjectBotRouter } from "./bot-router";
import { registerIdentityAccessTokenRouter } from "./identity-access-token-router";
import { registerIdentityAwsAuthRouter } from "./identity-aws-iam-auth-router";
+import { registerIdentityAzureAuthRouter } from "./identity-azure-auth-router";
import { registerIdentityGcpAuthRouter } from "./identity-gcp-auth-router";
+ import { registerIdentityKubernetesRouter } from "./identity-kubernetes-auth-router";
import { registerIdentityRouter } from "./identity-router";
import { registerIdentityUaRouter } from "./identity-ua";
import { registerIntegrationAuthRouter } from "./integration-auth-router";
diff --cc backend/src/services/identity-access-token/identity-access-token-dal.ts
index 05e268ffae,92bae670c2..7d819b99f8
--- a/backend/src/services/identity-access-token/identity-access-token-dal.ts
+++ b/backend/src/services/identity-access-token/identity-access-token-dal.ts
@@@ -39,18 -39,18 +39,25 @@@ export const identityAccessTokenDALFact
`${TableName.IdentityAwsAuth}.identityId`
);
})
+ .leftJoin(TableName.IdentityAzureAuth, (qb) => {
+ qb.on(`${TableName.Identity}.authMethod`, db.raw("?", [IdentityAuthMethod.AZURE_AUTH])).andOn(
+ `${TableName.Identity}.id`,
+ `${TableName.IdentityAzureAuth}.identityId`
+ );
+ })
+ .leftJoin(TableName.IdentityKubernetesAuth, (qb) => {
+ qb.on(`${TableName.Identity}.authMethod`, db.raw("?", [IdentityAuthMethod.KUBERNETES_AUTH])).andOn(
+ `${TableName.Identity}.id`,
+ `${TableName.IdentityKubernetesAuth}.identityId`
+ );
+ })
.select(selectAllTableCols(TableName.IdentityAccessToken))
.select(
db.ref("accessTokenTrustedIps").withSchema(TableName.IdentityUniversalAuth).as("accessTokenTrustedIpsUa"),
db.ref("accessTokenTrustedIps").withSchema(TableName.IdentityGcpAuth).as("accessTokenTrustedIpsGcp"),
db.ref("accessTokenTrustedIps").withSchema(TableName.IdentityAwsAuth).as("accessTokenTrustedIpsAws"),
- db.ref("accessTokenTrustedIps").withSchema(TableName.IdentityAwsAuth).as("accessTokenTrustedIpsAzure"),
++ db.ref("accessTokenTrustedIps").withSchema(TableName.IdentityAzureAuth).as("accessTokenTrustedIpsAzure"),
+ db.ref("accessTokenTrustedIps").withSchema(TableName.IdentityKubernetesAuth).as("accessTokenTrustedIpsK8s"),
db.ref("name").withSchema(TableName.Identity)
)
.first();
@@@ -63,7 -63,7 +70,8 @@@
doc.accessTokenTrustedIpsUa ||
doc.accessTokenTrustedIpsGcp ||
doc.accessTokenTrustedIpsAws ||
- doc.accessTokenTrustedIpsAzure
++ doc.accessTokenTrustedIpsAzure ||
+ doc.accessTokenTrustedIpsK8s
};
} catch (error) {
throw new DatabaseError({ error, name: "IdAccessTokenFindOne" });
diff --cc docs/documentation/platform/identities/machine-identities.mdx
index 4cb8dfd8c0,f189a3d20b..f9b5eb259d
--- a/docs/documentation/platform/identities/machine-identities.mdx
+++ b/docs/documentation/platform/identities/machine-identities.mdx
@@@ -7,9 -7,9 +7,14 @@@ description: "Learn how to use Machine
An Infisical machine identity is an entity that represents a workload or application that require access to various resources in Infisical. This is conceptually similar to an IAM user in AWS or service account in Google Cloud Platform (GCP).
++<<<<<<< HEAD
+Each identity must authenticate with the Infisical API using a supported authentication method like [Universal Auth](/documentation/platform/identities/universal-auth), [AWS Auth](/documentation/platform/identities/aws-auth), [Azure Auth](/documentation/platform/identities/azure-auth), or [GCP Auth](/documentation/platform/identities/gcp-auth) to get back a short-lived access token to be used in subsequent requests.
++=======
+ Each identity must authenticate with the Infisical API using a supported authentication method like [Universal Auth](/documentation/platform/identities/universal-auth), [Kubernetes Auth](/documentation/platform/identities/kubernetes-auth), [AWS Auth](/documentation/platform/identities/aws-auth), or [GCP Auth](/documentation/platform/identities/gcp-auth) to get back a short-lived access token to be used in subsequent requests.
+
-![organization identities](/images/platform/organization/organization-machine-identities.png)
++> > > > > > > origin
+
+![Organization Identities](/images/platform/organization/organization-machine-identities.png)
Key Features:
@@@ -38,10 -38,12 +43,11 @@@ Machine Identity support for the rest o
To interact with various resources in Infisical, Machine Identities are able to authenticate using:
- [Universal Auth](/documentation/platform/identities/universal-auth): A platform-agnostic authentication method that can be configured on an identity suitable to authenticate from any platform/environment.
+ - [Kubernetes Auth](/documentation/platform/identities/kubernetes-auth): A Kubernetes-native authentication method for applications (e.g. pods) to authenticate with Infisical.
-- [AWS Auth](/documentation/platform/identities/aws-auth): An AWS-native authentication method for IAM principals like EC2 instances or Lambda functions to authenticate with Infisical.
+- [AWS Auth](/documentation/platform/identities/aws-auth): An AWS-native authentication method for AWS services (e.g. EC2, Lambda functions, etc.) to authenticate with Infisical.
+- [Azure Auth](/documentation/platform/identities/azure-auth): An Azure-native authentication method for Azure resources (e.g. Azure VMs, Azure App Services, Azure Functions, Azure Kubernetes Service, etc.) to authenticate with Infisical.
- [GCP Auth](/documentation/platform/identities/gcp-auth): A GCP-native authentication method for GCP resources (e.g. Compute Engine, App Engine, Cloud Run, Google Kubernetes Engine, IAM service accounts, etc.) to authenticate with Infisical.
-IAM service accounts and GCE instances to authenticate with Infisical.
-
## FAQ
<AccordionGroup>
diff --cc docs/mint.json
index e35d05b44b,06b92711c0..e07def53b4
--- a/docs/mint.json
+++ b/docs/mint.json
@@@ -153,8 -158,8 +158,9 @@@
"documentation/platform/auth-methods/email-password",
"documentation/platform/token",
"documentation/platform/identities/universal-auth",
+ "documentation/platform/identities/kubernetes-auth",
"documentation/platform/identities/gcp-auth",
+ "documentation/platform/identities/azure-auth",
"documentation/platform/identities/aws-auth",
"documentation/platform/mfa",
{
diff --cc frontend/src/hooks/api/identities/constants.tsx
index 57dc5beb6c,8ae22b30c6..51495d4f24
--- a/frontend/src/hooks/api/identities/constants.tsx
+++ b/frontend/src/hooks/api/identities/constants.tsx
@@@ -2,7 -2,7 +2,8 @@@ import { IdentityAuthMethod } from "./e
export const identityAuthToNameMap: { [I in IdentityAuthMethod]: string } = {
[IdentityAuthMethod.UNIVERSAL_AUTH]: "Universal Auth",
+ [IdentityAuthMethod.KUBERNETES_AUTH]: "Kubernetes Auth",
[IdentityAuthMethod.GCP_AUTH]: "GCP Auth",
- [IdentityAuthMethod.AWS_AUTH]: "AWS Auth"
+ [IdentityAuthMethod.AWS_AUTH]: "AWS Auth",
+ [IdentityAuthMethod.AZURE_AUTH]: "Azure Auth"
};
diff --cc frontend/src/hooks/api/identities/enums.tsx
index bd51053f18,dc9d48cbd1..66af910939
--- a/frontend/src/hooks/api/identities/enums.tsx
+++ b/frontend/src/hooks/api/identities/enums.tsx
@@@ -1,6 -1,6 +1,7 @@@
export enum IdentityAuthMethod {
UNIVERSAL_AUTH = "universal-auth",
+ KUBERNETES_AUTH = "kubernetes-auth",
GCP_AUTH = "gcp-auth",
- AWS_AUTH = "aws-auth"
+ AWS_AUTH = "aws-auth",
+ AZURE_AUTH = "azure-auth"
}
diff --cc frontend/src/hooks/api/identities/index.tsx
index ce1f099bed,be640572bc..41b03669b9
--- a/frontend/src/hooks/api/identities/index.tsx
+++ b/frontend/src/hooks/api/identities/index.tsx
@@@ -2,8 -2,8 +2,9 @@@ export { identityAuthToNameMap } from "
export { IdentityAuthMethod } from "./enums";
export {
useAddIdentityAwsAuth,
+ useAddIdentityAzureAuth,
useAddIdentityGcpAuth,
+ useAddIdentityKubernetesAuth,
useAddIdentityUniversalAuth,
useCreateIdentity,
useCreateIdentityUniversalAuthClientSecret,
@@@ -11,13 -11,13 +12,16 @@@
useRevokeIdentityUniversalAuthClientSecret,
useUpdateIdentity,
useUpdateIdentityAwsAuth,
+ useUpdateIdentityAzureAuth,
useUpdateIdentityGcpAuth,
- useUpdateIdentityUniversalAuth} from "./mutations";
+ useUpdateIdentityKubernetesAuth,
- useUpdateIdentityUniversalAuth} from "./mutations";
++ useUpdateIdentityUniversalAuth
++} from "./mutations";
export {
useGetIdentityAwsAuth,
+ useGetIdentityAzureAuth,
useGetIdentityGcpAuth,
+ useGetIdentityKubernetesAuth,
useGetIdentityUniversalAuth,
useGetIdentityUniversalAuthClientSecrets
} from "./queries";
diff --cc frontend/src/hooks/api/identities/mutations.tsx
index 615d53336d,d6c93044a3..cb1fe4c170
--- a/frontend/src/hooks/api/identities/mutations.tsx
+++ b/frontend/src/hooks/api/identities/mutations.tsx
@@@ -6,8 -6,8 +6,9 @@@ import { organizationKeys } from "../or
import { identitiesKeys } from "./queries";
import {
AddIdentityAwsAuthDTO,
+ AddIdentityAzureAuthDTO,
AddIdentityGcpAuthDTO,
+ AddIdentityKubernetesAuthDTO,
AddIdentityUniversalAuthDTO,
ClientSecretData,
CreateIdentityDTO,
@@@ -17,14 -17,14 +18,17 @@@
DeleteIdentityUniversalAuthClientSecretDTO,
Identity,
IdentityAwsAuth,
+ IdentityAzureAuth,
IdentityGcpAuth,
+ IdentityKubernetesAuth,
IdentityUniversalAuth,
UpdateIdentityAwsAuthDTO,
+ UpdateIdentityAzureAuthDTO,
UpdateIdentityDTO,
UpdateIdentityGcpAuthDTO,
- UpdateIdentityUniversalAuthDTO} from "./types";
+ UpdateIdentityKubernetesAuthDTO,
- UpdateIdentityUniversalAuthDTO} from "./types";
++ UpdateIdentityUniversalAuthDTO
++} from "./types";
export const useCreateIdentity = () => {
const queryClient = useQueryClient();
@@@ -326,74 -326,87 +330,158 @@@ export const useUpdateIdentityAwsAuth
});
};
-// --- K8s auth (TODO: add cert and token reviewer JWT fields)
+export const useAddIdentityAzureAuth = () => {
+ const queryClient = useQueryClient();
+ return useMutation<IdentityAzureAuth, {}, AddIdentityAzureAuthDTO>({
+ mutationFn: async ({
+ identityId,
+ tenantId,
+ resource,
+ allowedServicePrincipalIds,
+ accessTokenTTL,
+ accessTokenMaxTTL,
+ accessTokenNumUsesLimit,
+ accessTokenTrustedIps
+ }) => {
+ const {
+ data: { identityAzureAuth }
+ } = await apiRequest.post<{ identityAzureAuth: IdentityAzureAuth }>(
+ `/api/v1/auth/azure-auth/identities/${identityId}`,
+ {
+ tenantId,
+ resource,
+ allowedServicePrincipalIds,
+ accessTokenTTL,
+ accessTokenMaxTTL,
+ accessTokenNumUsesLimit,
+ accessTokenTrustedIps
+ }
+ );
+
+ return identityAzureAuth;
+ },
+ onSuccess: (_, { organizationId }) => {
+ queryClient.invalidateQueries(organizationKeys.getOrgIdentityMemberships(organizationId));
+ }
+ });
+};
+ export const useAddIdentityKubernetesAuth = () => {
+ const queryClient = useQueryClient();
+ return useMutation<IdentityKubernetesAuth, {}, AddIdentityKubernetesAuthDTO>({
+ mutationFn: async ({
+ identityId,
+ kubernetesHost,
+ tokenReviewerJwt,
+ allowedNames,
+ allowedNamespaces,
+ allowedAudience,
+ caCert,
+ accessTokenTTL,
+ accessTokenMaxTTL,
+ accessTokenNumUsesLimit,
+ accessTokenTrustedIps
+ }) => {
+ const {
+ data: { identityKubernetesAuth }
+ } = await apiRequest.post<{ identityKubernetesAuth: IdentityKubernetesAuth }>(
+ `/api/v1/auth/kubernetes-auth/identities/${identityId}`,
+ {
+ kubernetesHost,
+ tokenReviewerJwt,
+ allowedNames,
+ allowedNamespaces,
+ allowedAudience,
+ caCert,
+ accessTokenTTL,
+ accessTokenMaxTTL,
+ accessTokenNumUsesLimit,
+ accessTokenTrustedIps
+ }
+ );
+
+ return identityKubernetesAuth;
+ },
+ onSuccess: (_, { organizationId }) => {
+ queryClient.invalidateQueries(organizationKeys.getOrgIdentityMemberships(organizationId));
+ }
+ });
+ };
+
+export const useUpdateIdentityAzureAuth = () => {
+ const queryClient = useQueryClient();
+ return useMutation<IdentityAzureAuth, {}, UpdateIdentityAzureAuthDTO>({
+ mutationFn: async ({
+ identityId,
+ tenantId,
+ resource,
+ allowedServicePrincipalIds,
+ accessTokenTTL,
+ accessTokenMaxTTL,
+ accessTokenNumUsesLimit,
+ accessTokenTrustedIps
+ }) => {
+ const {
+ data: { identityAzureAuth }
+ } = await apiRequest.patch<{ identityAzureAuth: IdentityAzureAuth }>(
+ `/api/v1/auth/azure-auth/identities/${identityId}`,
+ {
+ tenantId,
+ resource,
+ allowedServicePrincipalIds,
+ accessTokenTTL,
+ accessTokenMaxTTL,
+ accessTokenNumUsesLimit,
+ accessTokenTrustedIps
+ }
+ );
+
+ return identityAzureAuth;
+ },
+ onSuccess: (_, { organizationId }) => {
+ queryClient.invalidateQueries(organizationKeys.getOrgIdentityMemberships(organizationId));
+ }
+ });
+};
++
+ export const useUpdateIdentityKubernetesAuth = () => {
+ const queryClient = useQueryClient();
+ return useMutation<IdentityKubernetesAuth, {}, UpdateIdentityKubernetesAuthDTO>({
+ mutationFn: async ({
+ identityId,
+ kubernetesHost,
+ tokenReviewerJwt,
+ allowedNamespaces,
+ allowedNames,
+ allowedAudience,
+ caCert,
+ accessTokenTTL,
+ accessTokenMaxTTL,
+ accessTokenNumUsesLimit,
+ accessTokenTrustedIps
+ }) => {
+ const {
+ data: { identityKubernetesAuth }
+ } = await apiRequest.patch<{ identityKubernetesAuth: IdentityKubernetesAuth }>(
+ `/api/v1/auth/kubernetes-auth/identities/${identityId}`,
+ {
+ kubernetesHost,
+ tokenReviewerJwt,
+ allowedNames,
+ allowedNamespaces,
+ allowedAudience,
+ caCert,
+ accessTokenTTL,
+ accessTokenMaxTTL,
+ accessTokenNumUsesLimit,
+ accessTokenTrustedIps
+ }
+ );
++
+ return identityKubernetesAuth;
+ },
+ onSuccess: (_, { organizationId }) => {
+ queryClient.invalidateQueries(organizationKeys.getOrgIdentityMemberships(organizationId));
+ }
+ });
+ };
diff --cc frontend/src/hooks/api/identities/queries.tsx
index c5236a86e7,270827b52a..eb04227eb6
--- a/frontend/src/hooks/api/identities/queries.tsx
+++ b/frontend/src/hooks/api/identities/queries.tsx
@@@ -5,18 -5,20 +5,21 @@@ import { apiRequest } from "@app/config
import {
ClientSecretData,
IdentityAwsAuth,
+ IdentityAzureAuth,
IdentityGcpAuth,
+ IdentityKubernetesAuth,
- IdentityUniversalAuth
-} from "./types";
+ IdentityUniversalAuth} from "./types";
export const identitiesKeys = {
getIdentityUniversalAuth: (identityId: string) =>
[{ identityId }, "identity-universal-auth"] as const,
getIdentityUniversalAuthClientSecrets: (identityId: string) =>
[{ identityId }, "identity-universal-auth-client-secrets"] as const,
+ getIdentityKubernetesAuth: (identityId: string) =>
+ [{ identityId }, "identity-kubernetes-auth"] as const,
getIdentityGcpAuth: (identityId: string) => [{ identityId }, "identity-gcp-auth"] as const,
- getIdentityAwsAuth: (identityId: string) => [{ identityId }, "identity-aws-auth"] as const
+ getIdentityAwsAuth: (identityId: string) => [{ identityId }, "identity-aws-auth"] as const,
+ getIdentityAzureAuth: (identityId: string) => [{ identityId }, "identity-azure-auth"] as const
};
export const useGetIdentityUniversalAuth = (identityId: string) => {
@@@ -79,17 -81,17 +82,32 @@@ export const useGetIdentityAwsAuth = (i
});
};
+export const useGetIdentityAzureAuth = (identityId: string) => {
+ return useQuery({
+ enabled: Boolean(identityId),
+ queryKey: identitiesKeys.getIdentityAzureAuth(identityId),
+ queryFn: async () => {
+ const {
+ data: { identityAzureAuth }
+ } = await apiRequest.get<{ identityAzureAuth: IdentityAzureAuth }>(
+ `/api/v1/auth/azure-auth/identities/${identityId}`
+ );
+ return identityAzureAuth;
+ }
+ });
+};
++
+ export const useGetIdentityKubernetesAuth = (identityId: string) => {
+ return useQuery({
+ enabled: Boolean(identityId),
+ queryKey: identitiesKeys.getIdentityKubernetesAuth(identityId),
+ queryFn: async () => {
+ const {
+ data: { identityKubernetesAuth }
+ } = await apiRequest.get<{ identityKubernetesAuth: IdentityKubernetesAuth }>(
+ `/api/v1/auth/kubernetes-auth/identities/${identityId}`
+ );
+ return identityKubernetesAuth;
+ }
+ });
+ };
diff --cc frontend/src/hooks/api/identities/types.ts
index 4f756fa60a,7e09bf280e..80d066c720
--- a/frontend/src/hooks/api/identities/types.ts
+++ b/frontend/src/hooks/api/identities/types.ts
@@@ -195,45 -195,54 +195,93 @@@ export type UpdateIdentityAwsAuthDTO =
}[];
};
+export type IdentityAzureAuth = {
+ identityId: string;
+ tenantId: string;
+ resource: string;
+ allowedServicePrincipalIds: string;
+ accessTokenTTL: number;
+ accessTokenMaxTTL: number;
+ accessTokenNumUsesLimit: number;
+ accessTokenTrustedIps: IdentityTrustedIp[];
+};
+
+export type AddIdentityAzureAuthDTO = {
+ organizationId: string;
+ identityId: string;
+ tenantId: string;
+ resource: string;
+ allowedServicePrincipalIds: string;
+ accessTokenTTL: number;
+ accessTokenMaxTTL: number;
+ accessTokenNumUsesLimit: number;
+ accessTokenTrustedIps: {
+ ipAddress: string;
+ }[];
+};
+
+export type UpdateIdentityAzureAuthDTO = {
+ organizationId: string;
+ identityId: string;
+ tenantId?: string;
+ resource?: string;
+ allowedServicePrincipalIds?: string;
+ accessTokenTTL?: number;
+ accessTokenMaxTTL?: number;
+ accessTokenNumUsesLimit?: number;
+ accessTokenTrustedIps?: {
+ ipAddress: string;
+ }[];
+};
+
+ export type IdentityKubernetesAuth = {
+ identityId: string;
+ kubernetesHost: string;
+ tokenReviewerJwt: string;
+ allowedNamespaces: string;
+ allowedNames: string;
+ allowedAudience: string;
+ caCert: string;
+ accessTokenTTL: number;
+ accessTokenMaxTTL: number;
+ accessTokenNumUsesLimit: number;
+ accessTokenTrustedIps: IdentityTrustedIp[];
+ };
+
+ export type AddIdentityKubernetesAuthDTO = {
+ organizationId: string;
+ identityId: string;
+ kubernetesHost: string;
+ tokenReviewerJwt: string;
+ allowedNamespaces: string;
+ allowedNames: string;
+ allowedAudience: string;
+ caCert: string;
+ accessTokenTTL: number;
+ accessTokenMaxTTL: number;
+ accessTokenNumUsesLimit: number;
+ accessTokenTrustedIps: {
+ ipAddress: string;
+ }[];
+ };
+
+ export type UpdateIdentityKubernetesAuthDTO = {
+ organizationId: string;
+ identityId: string;
+ kubernetesHost?: string;
+ tokenReviewerJwt?: string;
+ allowedNamespaces?: string;
+ allowedNames?: string;
+ allowedAudience?: string;
+ caCert?: string;
+ accessTokenTTL?: number;
+ accessTokenMaxTTL?: number;
+ accessTokenNumUsesLimit?: number;
+ accessTokenTrustedIps?: {
+ ipAddress: string;
+ }[];
+ };
+
export type CreateIdentityUniversalAuthClientSecretDTO = {
identityId: string;
description?: string;
diff --cc frontend/src/views/Org/MembersPage/components/OrgIdentityTab/components/IdentitySection/IdentityAuthMethodModal.tsx
index b4cbca0a69,b088770502..a1dc5d678a
--- a/frontend/src/views/Org/MembersPage/components/OrgIdentityTab/components/IdentitySection/IdentityAuthMethodModal.tsx
+++ b/frontend/src/views/Org/MembersPage/components/OrgIdentityTab/components/IdentitySection/IdentityAuthMethodModal.tsx
@@@ -15,8 -15,8 +15,9 @@@ import { IdentityAuthMethod } from "@ap
import { UsePopUpState } from "@app/hooks/usePopUp";
import { IdentityAwsAuthForm } from "./IdentityAwsAuthForm";
+import { IdentityAzureAuthForm } from "./IdentityAzureAuthForm";
import { IdentityGcpAuthForm } from "./IdentityGcpAuthForm";
+ import { IdentityKubernetesAuthForm } from "./IdentityKubernetesAuthForm";
import { IdentityUniversalAuthForm } from "./IdentityUniversalAuthForm";
type Props = {
@@@ -30,9 -30,9 +31,10 @@@
const identityAuthMethods = [
{ label: "Universal Auth", value: IdentityAuthMethod.UNIVERSAL_AUTH },
+ { label: "Kubernetes Auth", value: IdentityAuthMethod.KUBERNETES_AUTH },
{ label: "GCP Auth", value: IdentityAuthMethod.GCP_AUTH },
- { label: "AWS Auth", value: IdentityAuthMethod.AWS_AUTH }
+ { label: "AWS Auth", value: IdentityAuthMethod.AWS_AUTH },
+ { label: "Azure Auth", value: IdentityAuthMethod.AZURE_AUTH }
];
const schema = yup