Skip to content

Commit 16314ac

Browse files
improvement(pam): add dynamic operation id (#5608)
* Add dynamic operationId generation for PAM and approval policy endpoints. * Remove dynamic operationId generation for PAM and approval policy endpoints * Add dynamic operationId generation for update and delete PAM account endpoints
1 parent 1048b62 commit 16314ac

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

backend/src/ee/routes/v1/pam-account-routers/pam-account-endpoints.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,21 @@ export const registerPamAccountEndpoints = <C extends TPamAccount>({
4141
}>;
4242
accountResponseSchema: z.ZodTypeAny;
4343
}) => {
44+
// Convert resource type enum value to PascalCase for operation IDs
45+
// e.g., "postgres" -> "Postgres", "aws-iam" -> "AwsIam"
46+
const resourceTypeId = resourceType
47+
.split("-")
48+
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
49+
.join("");
50+
4451
server.route({
4552
method: "POST",
4653
url: "/",
4754
config: {
4855
rateLimit: writeLimit
4956
},
5057
schema: {
58+
operationId: `create${resourceTypeId}PamAccount`,
5159
description: "Create PAM account",
5260
body: createAccountSchema,
5361
response: {
@@ -90,6 +98,7 @@ export const registerPamAccountEndpoints = <C extends TPamAccount>({
9098
rateLimit: writeLimit
9199
},
92100
schema: {
101+
operationId: `update${resourceTypeId}PamAccount`,
93102
description: "Update PAM account",
94103
params: z.object({
95104
accountId: z.string().uuid()
@@ -141,6 +150,7 @@ export const registerPamAccountEndpoints = <C extends TPamAccount>({
141150
rateLimit: writeLimit
142151
},
143152
schema: {
153+
operationId: `delete${resourceTypeId}PamAccount`,
144154
description: "Delete PAM account",
145155
params: z.object({
146156
accountId: z.string().uuid()

0 commit comments

Comments
 (0)