feat(machine-identity): Alibaba Cloud

This commit is contained in:
x032205
2025-06-11 02:44:53 -04:00
parent 0d7cd357c3
commit c315eed4d4
43 changed files with 1879 additions and 7 deletions
@@ -14,6 +14,7 @@ import {
IdentityLdapAuth,
IdentityMembership,
IdentityMembershipOrg,
IdentityAliCloudAuth,
IdentityOciAuth,
IdentityOidcAuth,
IdentityTokenAuth,
@@ -33,6 +34,8 @@ export const identitiesKeys = {
getIdentityGcpAuth: (identityId: string) => [{ identityId }, "identity-gcp-auth"] as const,
getIdentityOidcAuth: (identityId: string) => [{ identityId }, "identity-oidc-auth"] as const,
getIdentityAwsAuth: (identityId: string) => [{ identityId }, "identity-aws-auth"] as const,
getIdentityAliCloudAuth: (identityId: string) =>
[{ identityId }, "identity-alicloud-auth"] as const,
getIdentityOciAuth: (identityId: string) => [{ identityId }, "identity-oci-auth"] as const,
getIdentityAzureAuth: (identityId: string) => [{ identityId }, "identity-azure-auth"] as const,
getIdentityTokenAuth: (identityId: string) => [{ identityId }, "identity-token-auth"] as const,
@@ -193,6 +196,27 @@ export const useGetIdentityOciAuth = (
});
};
export const useGetIdentityAliCloudAuth = (
identityId: string,
options?: TReactQueryOptions["options"]
) => {
return useQuery({
queryKey: identitiesKeys.getIdentityAliCloudAuth(identityId),
queryFn: async () => {
const {
data: { identityAliCloudAuth }
} = await apiRequest.get<{ identityAliCloudAuth: IdentityAliCloudAuth }>(
`/api/v1/auth/alicloud-auth/identities/${identityId}`
);
return identityAliCloudAuth;
},
staleTime: 0,
gcTime: 0,
...options,
enabled: Boolean(identityId) && (options?.enabled ?? true)
});
};
export const useGetIdentityAzureAuth = (
identityId: string,
options?: TReactQueryOptions["options"]