mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 14:27:30 +00:00
Begin frontend for GCP IAM Auth
This commit is contained in:
@@ -2,13 +2,14 @@ import { useQuery } from "@tanstack/react-query";
|
||||
|
||||
import { apiRequest } from "@app/config/request";
|
||||
|
||||
import { ClientSecretData, IdentityUniversalAuth } from "./types";
|
||||
import { ClientSecretData, IdentityGcpIamAuth,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
|
||||
[{ identityId }, "identity-universal-auth-client-secrets"] as const,
|
||||
getIdentityGcpIamAuth: (identityId: string) => [{ identityId }, "identity-gcp-iam-auth"] as const
|
||||
};
|
||||
|
||||
export const useGetIdentityUniversalAuth = (identityId: string) => {
|
||||
@@ -44,3 +45,18 @@ export const useGetIdentityUniversalAuthClientSecrets = (identityId: string) =>
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
export const useGetIdentityGcpIamAuth = (identityId: string) => {
|
||||
return useQuery({
|
||||
enabled: Boolean(identityId),
|
||||
queryKey: identitiesKeys.getIdentityGcpIamAuth(identityId),
|
||||
queryFn: async () => {
|
||||
const {
|
||||
data: { identityGcpIamAuth }
|
||||
} = await apiRequest.get<{ identityGcpIamAuth: IdentityGcpIamAuth }>(
|
||||
`/api/v1/auth/gcp-iam-auth/identities/${identityId}`
|
||||
);
|
||||
return identityGcpIamAuth;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user