Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Setup bun
uses: oven-sh/setup-bun@v1
with:
bun-version: 1.0.24
bun-version: 1.0.26

- name: Install dependencies
run: cd interapp-backend && bun install
Expand Down
30 changes: 13 additions & 17 deletions interapp-backend/api/models/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ interface EmailOptions extends Mail.Options {
context: Record<string, unknown>;
}

type UserWithoutSensitiveFields = Omit<
User,
'password_hash' | 'refresh_token' | 'user_permissions' | 'user_services' | 'service_session_users'
>;

export class UserModel {
public static async getUser(username: string) {
const user = await appDataSource.manager
Expand All @@ -43,7 +48,12 @@ export class UserModel {
await appDataSource.manager.delete(User, { username });
}
// the following function does not expose sensitive information
public static async getUserDetails(username?: string) {
static async getUserDetails(username: string): Promise<UserWithoutSensitiveFields>;
static async getUserDetails(username?: undefined): Promise<UserWithoutSensitiveFields[]>;

public static async getUserDetails(
username?: string,
): Promise<UserWithoutSensitiveFields | UserWithoutSensitiveFields[]> {
const condition = username ? 'user.username = :username' : '1=1';
const users = await appDataSource.manager
.createQueryBuilder()
Expand Down Expand Up @@ -78,14 +88,7 @@ export class UserModel {
HTTPErrorCode.NOT_FOUND_ERROR,
);
case 1:
return users[0] as Omit<
User,
| 'password_hash'
| 'refresh_token'
| 'user_permissions'
| 'user_services'
| 'service_session_users'
>;
return users[0];
default:
throw new HTTPError(
'Multiple users found',
Expand All @@ -95,14 +98,7 @@ export class UserModel {
}
}

return users as Omit<
User,
| 'password_hash'
| 'refresh_token'
| 'user_permissions'
| 'user_services'
| 'service_session_users'
>[];
return users;
}
public static async changeEmail(username: string, new_email: string) {
const user = await appDataSource.manager
Expand Down
2 changes: 1 addition & 1 deletion interapp-backend/dev.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM oven/bun:1.0.24
FROM oven/bun:1.0.26
WORKDIR /app

COPY . .
Expand Down
2 changes: 1 addition & 1 deletion interapp-backend/prod.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM oven/bun:1.0.24
FROM oven/bun:1.0.26
WORKDIR /app

COPY . .
Expand Down
2 changes: 1 addition & 1 deletion interapp-backend/scheduler/dev.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM oven/bun:1.0.24
FROM oven/bun:1.0.26
WORKDIR /app

COPY . .
Expand Down
2 changes: 1 addition & 1 deletion interapp-backend/scheduler/prod.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM oven/bun:1.0.24
FROM oven/bun:1.0.26
WORKDIR /app

COPY . .
Expand Down
2 changes: 1 addition & 1 deletion interapp-backend/tests/config/test.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM oven/bun:1.0.24
FROM oven/bun:1.0.26
WORKDIR /app

COPY . .
Expand Down
Loading