feat(secret-rotation): Oracle DB

This commit is contained in:
x032205
2025-06-07 00:07:34 -04:00
parent b4f37193ac
commit 5ee2eb1aa2
49 changed files with 542 additions and 8 deletions
@@ -0,0 +1,3 @@
export * from "./oracledb-credentials-rotation-constants";
export * from "./oracledb-credentials-rotation-schemas";
export * from "./oracledb-credentials-rotation-types";
@@ -0,0 +1,20 @@
import { SecretRotation } from "@app/ee/services/secret-rotation-v2/secret-rotation-v2-enums";
import { TSecretRotationV2ListItem } from "@app/ee/services/secret-rotation-v2/secret-rotation-v2-types";
import { AppConnection } from "@app/services/app-connection/app-connection-enums";
export const ORACLEDB_CREDENTIALS_ROTATION_LIST_OPTION: TSecretRotationV2ListItem = {
name: "OracleDB Credentials",
type: SecretRotation.OracleDBCredentials,
connection: AppConnection.OracleDB,
template: {
createUserStatement: `-- create user
CREATE USER "infisical_user" IDENTIFIED BY "temporary_password";
-- grant all privileges
GRANT ALL PRIVILEGES TO "infisical_user";`,
secretsMapping: {
username: "ORACLEDB_USERNAME",
password: "ORACLEDB_PASSWORD"
}
}
};
@@ -0,0 +1,41 @@
import { z } from "zod";
import { SecretRotation } from "@app/ee/services/secret-rotation-v2/secret-rotation-v2-enums";
import {
BaseCreateSecretRotationSchema,
BaseSecretRotationSchema,
BaseUpdateSecretRotationSchema
} from "@app/ee/services/secret-rotation-v2/secret-rotation-v2-schemas";
import {
SqlCredentialsRotationParametersSchema,
SqlCredentialsRotationSecretsMappingSchema,
SqlCredentialsRotationTemplateSchema
} from "@app/ee/services/secret-rotation-v2/shared/sql-credentials";
import { AppConnection } from "@app/services/app-connection/app-connection-enums";
export const OracleDBCredentialsRotationSchema = BaseSecretRotationSchema(SecretRotation.OracleDBCredentials).extend({
type: z.literal(SecretRotation.OracleDBCredentials),
parameters: SqlCredentialsRotationParametersSchema,
secretsMapping: SqlCredentialsRotationSecretsMappingSchema
});
export const CreateOracleDBCredentialsRotationSchema = BaseCreateSecretRotationSchema(
SecretRotation.OracleDBCredentials
).extend({
parameters: SqlCredentialsRotationParametersSchema,
secretsMapping: SqlCredentialsRotationSecretsMappingSchema
});
export const UpdateOracleDBCredentialsRotationSchema = BaseUpdateSecretRotationSchema(
SecretRotation.OracleDBCredentials
).extend({
parameters: SqlCredentialsRotationParametersSchema.optional(),
secretsMapping: SqlCredentialsRotationSecretsMappingSchema.optional()
});
export const OracleDBCredentialsRotationListItemSchema = z.object({
name: z.literal("OracleDB Credentials"),
connection: z.literal(AppConnection.OracleDB),
type: z.literal(SecretRotation.OracleDBCredentials),
template: SqlCredentialsRotationTemplateSchema
});
@@ -0,0 +1,18 @@
import { z } from "zod";
import { TOracleDBConnection } from "../../app-connections/oracledb";
import {
CreateOracleDBCredentialsRotationSchema,
OracleDBCredentialsRotationListItemSchema,
OracleDBCredentialsRotationSchema
} from "./oracledb-credentials-rotation-schemas";
export type TOracleDBCredentialsRotation = z.infer<typeof OracleDBCredentialsRotationSchema>;
export type TOracleDBCredentialsRotationInput = z.infer<typeof CreateOracleDBCredentialsRotationSchema>;
export type TOracleDBCredentialsRotationListItem = z.infer<typeof OracleDBCredentialsRotationListItemSchema>;
export type TOracleDBCredentialsRotationWithConnection = TOracleDBCredentialsRotation & {
connection: TOracleDBConnection;
};