Compare commits

...

16 Commits

Author SHA1 Message Date
Maidul Islam
b65677a708 Merge pull request #1363 from akhilmhdh/feat/audit-log-desc
feat: enabled order by desc for audit log and added sort for couple of get queries
2024-02-02 12:07:57 -05:00
Maidul Islam
c1eb97ee53 revert port change 2024-02-02 11:51:27 -05:00
Akhil Mohan
937e48dbc5 feat: enabled order by desc for audit log and added sort for couple of get queries 2024-02-02 20:56:42 +05:30
Maidul Islam
72d46efba5 sort get secrets response for etags 2024-02-02 01:25:19 -05:00
Maidul Islam
b6eb08167f Update values.yaml 2024-02-01 22:45:54 -05:00
Maidul Islam
582472e4cc Update gamma values.yaml 2024-02-01 22:34:09 -05:00
Maidul Islam
3b3b76548b add etag 2024-02-01 20:49:07 -05:00
Maidul Islam
f8416ad891 add redis commander for local dev 2024-02-01 15:45:38 -05:00
Akhil Mohan
31e49672d5 Merge pull request #1359 from Infisical/daniel/fix-list-workspaces-id
(Fix): Add ID to list workspaces endpoint
2024-02-01 13:21:06 +05:30
Daniel Hougaard
9248bdf463 Update organization-router.ts 2024-02-01 11:47:33 +04:00
Maidul Islam
87c061ae9b Merge pull request #1357 from Infisical/danie/fix-list-workspaces
(Fix): List workspaces organization ID
2024-02-01 01:21:11 -05:00
Daniel Hougaard
e9fa631c8f Update project-dal.ts 2024-02-01 10:14:17 +04:00
vmatsiiako
cff15b64c4 Merge pull request #1355 from Grraahaam/doc/pr-template-broken-links
fix: update broken contribution links
2024-01-31 18:58:24 -08:00
vmatsiiako
136f5a6052 Merge pull request #1318 from rpmccarter/main
remove deprecated basePath setting
2024-01-31 18:56:11 -08:00
Grraahaam
7e8f9ec9e4 fix: update broken contribution links 2024-01-30 23:19:21 +01:00
Ronan McCarter
202efce10d remove deprecated basePath setting 2024-01-22 15:50:31 -08:00
15 changed files with 54 additions and 20 deletions

View File

@@ -1,6 +1,6 @@
# Description 📣
<!-- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. -->
<!-- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. Here's how we expect a pull request to be : https://infisical.com/docs/contributing/getting-started/pull-requests -->
## Type ✨
@@ -19,4 +19,6 @@
---
- [ ] I have read the [contributing guide](https://infisical.com/docs/contributing/overview), agreed and acknowledged the [code of conduct](https://infisical.com/docs/contributing/code-of-conduct). 📝
- [ ] I have read the [contributing guide](https://infisical.com/docs/contributing/getting-started/overview), agreed and acknowledged the [code of conduct](https://infisical.com/docs/contributing/getting-started/code-of-conduct). 📝
<!-- If you have any questions regarding contribution, here's the FAQ : https://infisical.com/docs/contributing/getting-started/faq -->

8
.github/values.yaml vendored
View File

@@ -19,14 +19,14 @@ infisical:
## @param backend.name Backend name
##
name: infisical
replicaCount: 2
replicaCount: 3
image:
repository: infisical/infisical
tag: "latest-postgres"
repository: infisical/staging_infisical
tag: "latest"
pullPolicy: IfNotPresent
deploymentAnnotations:
secrets.infisical.com/auto-reload: "true"
secrets.infisical.com/auto-reload: "false"
kubeSecretRef: "infisical-gamma-secrets"

View File

@@ -13,6 +13,7 @@
"@casl/ability": "^6.5.0",
"@fastify/cookie": "^9.2.0",
"@fastify/cors": "^8.4.1",
"@fastify/etag": "^5.1.0",
"@fastify/formbody": "^7.4.0",
"@fastify/helmet": "^11.1.1",
"@fastify/passport": "^2.4.0",
@@ -1671,6 +1672,14 @@
"resolved": "https://registry.npmjs.org/@fastify/error/-/error-3.4.1.tgz",
"integrity": "sha512-wWSvph+29GR783IhmvdwWnN4bUxTD01Vm5Xad4i7i1VuAOItLvbPAb69sb0IQ2N57yprvhNIwAP5B6xfKTmjmQ=="
},
"node_modules/@fastify/etag": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/@fastify/etag/-/etag-5.1.0.tgz",
"integrity": "sha512-j/huE8baxgF22idzY35a579b6uP+9ykE9Jt02xY4ZApELNr2KGZmQOKTQsZS94TfKMLfPHwkoM8FfZRq8OZDXg==",
"dependencies": {
"fastify-plugin": "^4.0.0"
}
},
"node_modules/@fastify/fast-json-stringify-compiler": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/@fastify/fast-json-stringify-compiler/-/fast-json-stringify-compiler-4.3.0.tgz",

View File

@@ -67,6 +67,7 @@
"@casl/ability": "^6.5.0",
"@fastify/cookie": "^9.2.0",
"@fastify/cors": "^8.4.1",
"@fastify/etag": "^5.1.0",
"@fastify/formbody": "^7.4.0",
"@fastify/helmet": "^11.1.1",
"@fastify/passport": "^2.4.0",

View File

@@ -38,7 +38,8 @@ export const auditLogDALFactory = (db: TDbClient) => {
})
)
.limit(limit)
.offset(offset);
.offset(offset)
.orderBy("createdAt", "desc");
if (startDate) {
void sqlQuery.where("createdAt", ">=", startDate);
}

View File

@@ -5,6 +5,7 @@ import type { FastifyCookieOptions } from "@fastify/cookie";
import cookie from "@fastify/cookie";
import type { FastifyCorsOptions } from "@fastify/cors";
import cors from "@fastify/cors";
import fastifyEtag from "@fastify/etag";
import fastifyFormBody from "@fastify/formbody";
import helmet from "@fastify/helmet";
import type { FastifyRateLimitOptions } from "@fastify/rate-limit";
@@ -50,6 +51,8 @@ export const main = async ({ db, smtp, logger, queue }: TMain) => {
secret: appCfg.COOKIE_SECRET_SIGN_KEY
});
await server.register(fastifyEtag);
await server.register<FastifyCorsOptions>(cors, {
credentials: true,
origin: appCfg.SITE_URL || true

View File

@@ -49,6 +49,7 @@ export const registerOrgRouter = async (server: FastifyZodProvider) => {
200: z.object({
workspaces: z
.object({
id: z.string(),
name: z.string(),
organization: z.string(),
environments: z

View File

@@ -41,7 +41,7 @@ export const projectDALFactory = (db: TDbClient) => {
return nestedWorkspaces.map((workspace) => ({
...workspace,
organization: workspace.id
organization: workspace.orgId
}));
} catch (error) {
throw new DatabaseError({ error, name: "Find all projects" });
@@ -83,7 +83,7 @@ export const projectDALFactory = (db: TDbClient) => {
// We need to add the organization field, as it's required for one of our API endpoint responses.
return nestedWorkspaces.map((workspace) => ({
...workspace,
organization: workspace.id
organization: workspace.orgId
}));
} catch (error) {
throw new DatabaseError({ error, name: "Find all projects by identity" });

View File

@@ -25,10 +25,15 @@ export const fnSecretsFromImports = async ({
if (!folderIds.length) {
return [];
}
const importedSecrets = await secretDAL.find({
$in: { folderId: folderIds },
type: SecretType.Shared
});
const importedSecrets = await secretDAL.find(
{
$in: { folderId: folderIds },
type: SecretType.Shared
},
{
sort: [["createdAt", "desc"]]
}
);
const importedSecsGroupByFolderId = groupBy(importedSecrets, (i) => i.folderId);
return allowedImports.map(({ importPath, importEnv }, i) => ({

View File

@@ -47,7 +47,7 @@ export const secretTagServiceFactory = ({ secretTagDAL, permissionService }: TSe
const { permission } = await permissionService.getProjectPermission(actor, actorId, projectId);
ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Read, ProjectPermissionSub.Tags);
const tags = await secretTagDAL.find({ projectId });
const tags = await secretTagDAL.find({ projectId }, { sort: [["createdAt", "asc"]] });
return tags;
};

View File

@@ -86,7 +86,8 @@ export const secretDALFactory = (db: TDbClient) => {
.select(db.ref("id").withSchema(TableName.SecretTag).as("tagId"))
.select(db.ref("color").withSchema(TableName.SecretTag).as("tagColor"))
.select(db.ref("slug").withSchema(TableName.SecretTag).as("tagSlug"))
.select(db.ref("name").withSchema(TableName.SecretTag).as("tagName"));
.select(db.ref("name").withSchema(TableName.SecretTag).as("tagName"))
.orderBy("createdAt", "desc");
const data = sqlNestRelationships({
data: secs,
key: "id",

View File

@@ -117,7 +117,7 @@ export const serviceTokenServiceFactory = ({
const { permission } = await permissionService.getProjectPermission(actor, actorId, projectId);
ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Read, ProjectPermissionSub.ServiceTokens);
const tokens = await serviceTokenDAL.find({ projectId });
const tokens = await serviceTokenDAL.find({ projectId }, { sort: [["createdAt", "desc"]] });
return tokens;
};

View File

@@ -80,7 +80,8 @@ export const webhookDALFactory = (db: TDbClient) => {
.select(db.ref("slug").withSchema(TableName.Environment).as("envSlug"))
.select(db.ref("id").withSchema(TableName.Environment).as("envId"))
.select(db.ref("projectId").withSchema(TableName.Environment))
.select(selectAllTableCols(TableName.Webhook));
.select(selectAllTableCols(TableName.Webhook))
.orderBy(`${TableName.Webhook}.createdAt`, "asc");
return webhooks.map(({ envId, envSlug, envName, ...el }) => ({
...el,

View File

@@ -34,6 +34,17 @@ services:
volumes:
- redis_data:/data
redis-commander:
container_name: infisical-dev-redis-commander
image: rediscommander/redis-commander
restart: always
depends_on:
- redis
environment:
- REDIS_HOSTS=local:redis:6379
ports:
- "8085:8081"
db-test:
profiles: ["test"]
image: postgres:14-alpine

View File

@@ -1,9 +1,8 @@
{
"name": "Infisical",
"basePath": "/docs",
"logo": {
"dark": "/docs/logo/dark.svg",
"light": "/docs/logo/light.svg",
"dark": "/logo/dark.svg",
"light": "/logo/light.svg",
"href": "https://infisical.com"
},
"favicon": "/favicon.png",