mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
requested changes
This commit is contained in:
@@ -61,21 +61,23 @@ export const redisCredentialsRotationFactory: TRotationFactory<
|
||||
* Creates a new user and password for the redis user using ACL
|
||||
*/
|
||||
const $rotateAclUser = async () => {
|
||||
const client = await $getClient();
|
||||
|
||||
const username = generatePassword({
|
||||
length: 32,
|
||||
required: {
|
||||
symbols: 0,
|
||||
digits: 5,
|
||||
uppercase: 5,
|
||||
lowercase: 5
|
||||
}
|
||||
});
|
||||
|
||||
const password = generatePassword(parameters.passwordRequirements || DEFAULT_PASSWORD_REQUIREMENTS);
|
||||
let client: Redis | null = null;
|
||||
|
||||
try {
|
||||
client = await $getClient();
|
||||
|
||||
const username = generatePassword({
|
||||
length: 32,
|
||||
required: {
|
||||
symbols: 0,
|
||||
digits: 5,
|
||||
uppercase: 5,
|
||||
lowercase: 5
|
||||
}
|
||||
});
|
||||
|
||||
const password = generatePassword(parameters.passwordRequirements || DEFAULT_PASSWORD_REQUIREMENTS);
|
||||
|
||||
// important: permissionScope is user input so we need to sanitize it, which we do by splitting the permission scope into parts and then passing them to the ACL command as separate arguments
|
||||
const permissionParts = (parameters.permissionScope || "~* +@all").split(" ");
|
||||
await client.call("ACL", "SETUSER", username, `>${password}`, "on", ...permissionParts);
|
||||
@@ -88,6 +90,8 @@ export const redisCredentialsRotationFactory: TRotationFactory<
|
||||
throw new BadRequestError({
|
||||
message: "Unable to validate connection: verify credentials"
|
||||
});
|
||||
} finally {
|
||||
if (client) await client.quit();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -95,14 +99,17 @@ export const redisCredentialsRotationFactory: TRotationFactory<
|
||||
* Revokes a ACL password from the Redis server using its username and password.
|
||||
*/
|
||||
const revokeCredential = async (username: string) => {
|
||||
const client = await $getClient();
|
||||
let client: Redis | null = null;
|
||||
|
||||
try {
|
||||
client = await $getClient();
|
||||
await client.call("ACL", "DELUSER", username);
|
||||
} catch (error: unknown) {
|
||||
throw new BadRequestError({
|
||||
message: "Unable to revoke credential: verify credentials"
|
||||
});
|
||||
} finally {
|
||||
if (client) await client.quit();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -61,8 +61,8 @@ export const ValidateRedisConnectionCredentialsSchema = z.discriminatedUnion("me
|
||||
|
||||
export const CreateRedisConnectionSchema = ValidateRedisConnectionCredentialsSchema.and(
|
||||
GenericCreateAppConnectionFieldsSchema(AppConnection.Redis, {
|
||||
supportsPlatformManagedCredentials: true,
|
||||
supportsGateways: true
|
||||
supportsPlatformManagedCredentials: false,
|
||||
supportsGateways: false
|
||||
})
|
||||
);
|
||||
|
||||
@@ -74,8 +74,8 @@ export const UpdateRedisConnectionSchema = z
|
||||
})
|
||||
.and(
|
||||
GenericUpdateAppConnectionFieldsSchema(AppConnection.Redis, {
|
||||
supportsPlatformManagedCredentials: true,
|
||||
supportsGateways: true
|
||||
supportsPlatformManagedCredentials: false,
|
||||
supportsGateways: false
|
||||
})
|
||||
);
|
||||
|
||||
|
||||
@@ -134,14 +134,14 @@
|
||||
"integrations/app-connections/oracledb",
|
||||
"integrations/app-connections/postgres",
|
||||
"integrations/app-connections/railway",
|
||||
"integrations/app-connections/redis",
|
||||
"integrations/app-connections/render",
|
||||
"integrations/app-connections/supabase",
|
||||
"integrations/app-connections/teamcity",
|
||||
"integrations/app-connections/terraform-cloud",
|
||||
"integrations/app-connections/vercel",
|
||||
"integrations/app-connections/windmill",
|
||||
"integrations/app-connections/zabbix",
|
||||
"integrations/app-connections/redis"
|
||||
"integrations/app-connections/zabbix"
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -1881,6 +1881,18 @@
|
||||
"api-reference/endpoints/app-connections/railway/delete"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "Redis",
|
||||
"pages": [
|
||||
"api-reference/endpoints/app-connections/redis/list",
|
||||
"api-reference/endpoints/app-connections/redis/available",
|
||||
"api-reference/endpoints/app-connections/redis/get-by-id",
|
||||
"api-reference/endpoints/app-connections/redis/get-by-name",
|
||||
"api-reference/endpoints/app-connections/redis/create",
|
||||
"api-reference/endpoints/app-connections/redis/update",
|
||||
"api-reference/endpoints/app-connections/redis/delete"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "Render",
|
||||
"pages": [
|
||||
@@ -1964,18 +1976,6 @@
|
||||
"api-reference/endpoints/app-connections/zabbix/update",
|
||||
"api-reference/endpoints/app-connections/zabbix/delete"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "Redis",
|
||||
"pages": [
|
||||
"api-reference/endpoints/app-connections/redis/list",
|
||||
"api-reference/endpoints/app-connections/redis/available",
|
||||
"api-reference/endpoints/app-connections/redis/get-by-id",
|
||||
"api-reference/endpoints/app-connections/redis/get-by-name",
|
||||
"api-reference/endpoints/app-connections/redis/create",
|
||||
"api-reference/endpoints/app-connections/redis/update",
|
||||
"api-reference/endpoints/app-connections/redis/delete"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
BIN
docs/images/app-connections/redis/redis-app-connection-form.png
Normal file
BIN
docs/images/app-connections/redis/redis-app-connection-form.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 440 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 500 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 543 KiB |
Reference in New Issue
Block a user