mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-15 18:15:53 +00:00
Merge remote-tracking branch 'origin/main' into feat/add-key-usages-for-template-and-cert
This commit is contained in:
@@ -24,6 +24,7 @@ import {
|
||||
SRP1DTO,
|
||||
SRPR1Res,
|
||||
TOauthTokenExchangeDTO,
|
||||
UserAgentType,
|
||||
VerifyMfaTokenDTO,
|
||||
VerifyMfaTokenRes,
|
||||
VerifySignupInviteDTO
|
||||
@@ -60,7 +61,10 @@ export const useLogin1 = () => {
|
||||
});
|
||||
};
|
||||
|
||||
export const selectOrganization = async (data: { organizationId: string }) => {
|
||||
export const selectOrganization = async (data: {
|
||||
organizationId: string;
|
||||
userAgent?: UserAgentType;
|
||||
}) => {
|
||||
const { data: res } = await apiRequest.post<{ token: string }>(
|
||||
"/api/v3/auth/select-organization",
|
||||
data
|
||||
@@ -71,11 +75,14 @@ export const selectOrganization = async (data: { organizationId: string }) => {
|
||||
export const useSelectOrganization = () => {
|
||||
const queryClient = useQueryClient();
|
||||
return useMutation({
|
||||
mutationFn: async (details: { organizationId: string }) => {
|
||||
mutationFn: async (details: { organizationId: string; userAgent?: UserAgentType }) => {
|
||||
const data = await selectOrganization(details);
|
||||
|
||||
SecurityClient.setToken(data.token);
|
||||
SecurityClient.setProviderAuthToken("");
|
||||
// If a custom user agent is set, then this session is meant for another consuming application, not the web application.
|
||||
if (!details.userAgent) {
|
||||
SecurityClient.setToken(data.token);
|
||||
SecurityClient.setProviderAuthToken("");
|
||||
}
|
||||
|
||||
return data;
|
||||
},
|
||||
|
||||
@@ -145,3 +145,7 @@ export type IssueBackupPrivateKeyDTO = {
|
||||
export type GetBackupEncryptedPrivateKeyDTO = {
|
||||
verificationToken: string;
|
||||
};
|
||||
|
||||
export enum UserAgentType {
|
||||
CLI = "cli"
|
||||
}
|
||||
|
||||
@@ -23,7 +23,8 @@ export enum DynamicSecretProviders {
|
||||
AwsElastiCache = "aws-elasticache",
|
||||
MongoAtlas = "mongo-db-atlas",
|
||||
ElasticSearch = "elastic-search",
|
||||
MongoDB = "mongo-db"
|
||||
MongoDB = "mongo-db",
|
||||
RabbitMq = "rabbit-mq"
|
||||
}
|
||||
|
||||
export enum SqlProviders {
|
||||
@@ -155,6 +156,27 @@ export type TDynamicSecretProvider =
|
||||
apiKeyId: string;
|
||||
};
|
||||
};
|
||||
}
|
||||
| {
|
||||
type: DynamicSecretProviders.RabbitMq;
|
||||
inputs: {
|
||||
host: string;
|
||||
port: number;
|
||||
|
||||
username: string;
|
||||
password: string;
|
||||
|
||||
tags: string[];
|
||||
virtualHost: {
|
||||
name: string;
|
||||
permissions: {
|
||||
configure: string;
|
||||
write: string;
|
||||
read: string;
|
||||
};
|
||||
};
|
||||
ca?: string;
|
||||
};
|
||||
};
|
||||
|
||||
export type TCreateDynamicSecretDTO = {
|
||||
|
||||
Reference in New Issue
Block a user