mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 16:27:40 +00:00
greptile review fixes + schema generate
This commit is contained in:
@@ -13,7 +13,7 @@ export const PamResourcesSchema = z.object({
|
|||||||
id: z.string().uuid(),
|
id: z.string().uuid(),
|
||||||
projectId: z.string(),
|
projectId: z.string(),
|
||||||
name: z.string(),
|
name: z.string(),
|
||||||
gatewayId: z.string(),
|
gatewayId: z.string().uuid(),
|
||||||
resourceType: z.string(),
|
resourceType: z.string(),
|
||||||
encryptedConnectionDetails: zodBuffer,
|
encryptedConnectionDetails: zodBuffer,
|
||||||
createdAt: z.date(),
|
createdAt: z.date(),
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ export const PamSessionsSchema = z.object({
|
|||||||
actorUserAgent: z.string(),
|
actorUserAgent: z.string(),
|
||||||
status: z.string(),
|
status: z.string(),
|
||||||
encryptedLogsBlob: zodBuffer.nullable().optional(),
|
encryptedLogsBlob: zodBuffer.nullable().optional(),
|
||||||
expiresAt: z.date().nullable().optional(),
|
expiresAt: z.date(),
|
||||||
startedAt: z.date().nullable().optional(),
|
startedAt: z.date().nullable().optional(),
|
||||||
endedAt: z.date().nullable().optional(),
|
endedAt: z.date().nullable().optional(),
|
||||||
createdAt: z.date(),
|
createdAt: z.date(),
|
||||||
|
|||||||
@@ -138,7 +138,8 @@ export const registerPamSessionRouter = async (server: FastifyZodProvider) => {
|
|||||||
event: {
|
event: {
|
||||||
type: EventType.PAM_SESSION_END,
|
type: EventType.PAM_SESSION_END,
|
||||||
metadata: {
|
metadata: {
|
||||||
sessionId: req.params.sessionId
|
sessionId: req.params.sessionId,
|
||||||
|
accountName: session.accountName
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -3726,6 +3726,7 @@ interface PamSessionEndEvent {
|
|||||||
type: EventType.PAM_SESSION_END;
|
type: EventType.PAM_SESSION_END;
|
||||||
metadata: {
|
metadata: {
|
||||||
sessionId: string;
|
sessionId: string;
|
||||||
|
accountName: string;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -405,6 +405,7 @@ export const pamAccountServiceFactory = ({
|
|||||||
);
|
);
|
||||||
|
|
||||||
const user = await userDAL.findById(actor.id);
|
const user = await userDAL.findById(actor.id);
|
||||||
|
if (!user) throw new NotFoundError({ message: `User with ID '${actor.id}' not found` });
|
||||||
|
|
||||||
const gatewayConnectionDetails = await gatewayV2Service.getPAMConnectionDetails({
|
const gatewayConnectionDetails = await gatewayV2Service.getPAMConnectionDetails({
|
||||||
gatewayId,
|
gatewayId,
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { PamAccountsSchema, PamResourcesSchema } from "@app/db/schemas";
|
|||||||
import { slugSchema } from "@app/server/lib/schemas";
|
import { slugSchema } from "@app/server/lib/schemas";
|
||||||
|
|
||||||
// Resources
|
// Resources
|
||||||
export const BasePamResoureSchema = PamResourcesSchema.omit({
|
export const BasePamResourceSchema = PamResourcesSchema.omit({
|
||||||
encryptedConnectionDetails: true,
|
encryptedConnectionDetails: true,
|
||||||
resourceType: true
|
resourceType: true
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import {
|
|||||||
BaseCreatePamResourceSchema,
|
BaseCreatePamResourceSchema,
|
||||||
BasePamAccountSchema,
|
BasePamAccountSchema,
|
||||||
BasePamAccountSchemaWithResource,
|
BasePamAccountSchemaWithResource,
|
||||||
BasePamResoureSchema,
|
BasePamResourceSchema,
|
||||||
BaseUpdatePamAccountSchema,
|
BaseUpdatePamAccountSchema,
|
||||||
BaseUpdatePamResourceSchema
|
BaseUpdatePamResourceSchema
|
||||||
} from "../pam-resource-schemas";
|
} from "../pam-resource-schemas";
|
||||||
@@ -18,7 +18,7 @@ import {
|
|||||||
// Resources
|
// Resources
|
||||||
export const PostgresResourceConnectionDetailsSchema = BaseSqlResourceConnectionDetailsSchema;
|
export const PostgresResourceConnectionDetailsSchema = BaseSqlResourceConnectionDetailsSchema;
|
||||||
|
|
||||||
const BasePostgresResourceSchema = BasePamResoureSchema.extend({ resourceType: z.literal(PamResource.Postgres) });
|
const BasePostgresResourceSchema = BasePamResourceSchema.extend({ resourceType: z.literal(PamResource.Postgres) });
|
||||||
|
|
||||||
export const PostgresResourceSchema = BasePostgresResourceSchema.extend({
|
export const PostgresResourceSchema = BasePostgresResourceSchema.extend({
|
||||||
connectionDetails: PostgresResourceConnectionDetailsSchema
|
connectionDetails: PostgresResourceConnectionDetailsSchema
|
||||||
|
|||||||
Reference in New Issue
Block a user