Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BC-5522-Implementation of an API for deleting data #4533

Merged
merged 125 commits into from
Nov 30, 2023
Merged
Changes from 1 commit
Commits
Show all changes
125 commits
Select commit Hold shift + click to select a range
cce8684
endpoints preparation
sszafGCA Nov 8, 2023
aa32e24
Merge remote-tracking branch 'origin' into BC-5522-impl-of-deletion-api
sszafGCA Nov 8, 2023
5308f8f
Merge branch 'main' into BC-5522-impl-of-deletion-api
sszafGCA Nov 9, 2023
d6e0922
Merge branch 'main' into BC-5522-impl-of-deletion-api
sszafGCA Nov 9, 2023
175e495
auth startegy impl
sszafGCA Nov 9, 2023
fd2b9b8
api impl
sszafGCA Nov 10, 2023
7d3b626
some changes
WojciechGrancow Nov 10, 2023
a954f6b
some fixes need in KNL module
WojciechGrancow Nov 11, 2023
a07bd74
Merge branch 'main' into BC-5522-impl-of-deletion-api
WojciechGrancow Nov 11, 2023
60aa0ac
changes in uc and register entities
WojciechGrancow Nov 12, 2023
c65367b
Pr fixes and minor changes
sszafGCA Nov 12, 2023
bf27fd8
rename file
sszafGCA Nov 12, 2023
d477ba7
some fixes
WojciechGrancow Nov 13, 2023
762a9ee
Merge branch 'main' into BC-5522-impl-of-deletion-api
WojciechGrancow Nov 13, 2023
80430f5
add exposing admin API port from the api-svc
bn-pass Nov 13, 2023
24b823c
add server test module + delete FileEntity from allEntities
sszafGCA Nov 13, 2023
f4e10ff
change module
sszafGCA Nov 13, 2023
f2f2a5d
admin api server module test impl
sszafGCA Nov 13, 2023
9c4be9e
add some tests
WojciechGrancow Nov 14, 2023
4ab94f8
Merge branch 'BC-5522-impl-of-deletion-api' of https://github.com/hpi…
WojciechGrancow Nov 14, 2023
9a790fd
Merge branch 'main' into BC-5522-impl-of-deletion-api
WojciechGrancow Nov 14, 2023
b5e2a01
add some test for API
WojciechGrancow Nov 14, 2023
495e953
Merge branch 'main' into BC-5522-impl-of-deletion-api
WojciechGrancow Nov 14, 2023
bd430e9
add some test
WojciechGrancow Nov 14, 2023
fb3012f
Merge branch 'main' into BC-5522-impl-of-deletion-api
WojciechGrancow Nov 14, 2023
caf07ab
x-api-key.strategy tests
sszafGCA Nov 14, 2023
b040876
x-api-key-strategy-tests impl
sszafGCA Nov 14, 2023
0d3074e
remove test for api-setup-helper, remove unused imports
sszafGCA Nov 14, 2023
d935d13
remove test file
sszafGCA Nov 14, 2023
01340fb
add info for the Admin API port
bn-pass Nov 15, 2023
c866efe
add test for controller
WojciechGrancow Nov 15, 2023
bf68c68
Merge branch 'BC-5522-impl-of-deletion-api' of https://github.com/hpi…
WojciechGrancow Nov 15, 2023
adb77c9
add test for deletionRequestResponse
WojciechGrancow Nov 15, 2023
3f046f5
remove not needed parameter from constructor
sszafGCA Nov 15, 2023
9a04a4a
add test for deletionRequestLogResponse
WojciechGrancow Nov 15, 2023
9ea749f
Merge branch 'BC-5522-impl-of-deletion-api' of https://github.com/hpi…
WojciechGrancow Nov 15, 2023
46c98b2
add test for executionParams and requestbodyParams
WojciechGrancow Nov 15, 2023
539c173
replace hard-coded Admin API server port value with the one taken fro…
bn-pass Nov 15, 2023
c1f1f35
change creation of API method location
sszafGCA Nov 15, 2023
9ad4206
change default json
sszafGCA Nov 15, 2023
f422a7b
fix import in server module
sszafGCA Nov 15, 2023
8c46093
Merge branch 'main' into BC-5522-impl-of-deletion-api
sszafGCA Nov 15, 2023
3b58d13
fixes soma issues
WojciechGrancow Nov 15, 2023
01bdd63
Merge branch 'BC-5522-impl-of-deletion-api' of https://github.com/hpi…
WojciechGrancow Nov 15, 2023
4fc4c70
fixes after review
WojciechGrancow Nov 15, 2023
aba6e1a
add admin api object
sszafGCA Nov 15, 2023
6764f95
default json chnages
sszafGCA Nov 15, 2023
15ed045
Revert "default json chnages"
sszafGCA Nov 15, 2023
2a15fe3
Revert "add admin api object"
sszafGCA Nov 15, 2023
2e80ece
Revert "fixes after review"
sszafGCA Nov 15, 2023
c57995f
Revert "fixes soma issues"
sszafGCA Nov 15, 2023
011b0f7
fixes after review
WojciechGrancow Nov 16, 2023
ccf0aef
small fixes
WojciechGrancow Nov 16, 2023
30ab3f4
Revert "small fixes"
sszafGCA Nov 16, 2023
6feb0a8
Revert "Revert "small fixes""
sszafGCA Nov 16, 2023
8b6243e
default ADMIN_API_KEY
WojciechGrancow Nov 16, 2023
2ffb06a
fix some imports
WojciechGrancow Nov 16, 2023
4bbf149
small change in x-api-key.strategy
WojciechGrancow Nov 16, 2023
a6f0b6a
Merge branch 'main' into BC-5522-impl-of-deletion-api
sszafGCA Nov 16, 2023
0188096
Update apps/server/src/modules/deletion/uc/builder/deletion-log-stati…
WojciechGrancow Nov 16, 2023
2e07dc3
change default.schema.json
sszafGCA Nov 16, 2023
3826319
new changes to default.schema.json
sszafGCA Nov 16, 2023
a0046bc
fix after review
WojciechGrancow Nov 16, 2023
8373501
add logger for error in deeltionRequestUC
WojciechGrancow Nov 17, 2023
2695b3d
fix problem with fileentity
WojciechGrancow Nov 17, 2023
92dba86
fix imports
WojciechGrancow Nov 17, 2023
3155b71
add logger to test in uc of deletionModule
WojciechGrancow Nov 17, 2023
2196f1e
change module config
sszafGCA Nov 17, 2023
c0ae9d7
hard-coded Admin API server port after the discussion with Paul
bn-pass Nov 17, 2023
b0c730b
fixes bug during deletion uders data from lessons
WojciechGrancow Nov 17, 2023
3a8f8d4
Merge branch 'main' into BC-5522-impl-of-deletion-api
WojciechGrancow Nov 17, 2023
684cd52
Merge branch 'BC-5522-impl-of-deletion-api' of https://github.com/hpi…
WojciechGrancow Nov 17, 2023
7a97f28
merge with main
WojciechGrancow Nov 21, 2023
9d40aea
fix pipeline
sszafGCA Nov 21, 2023
87cdfd2
fix pipeline #2
sszafGCA Nov 21, 2023
048875d
fix pipeline
sszafGCA Nov 21, 2023
8ccf2d6
fix lint
sszafGCA Nov 21, 2023
d2fc5dc
Merge branch 'main' into BC-5522-impl-of-deletion-api
sszafGCA Nov 23, 2023
2848964
Merge branch 'main' into BC-5522-impl-of-deletion-api
sszafGCA Nov 23, 2023
1e0bb2d
fix modules imports
sszafGCA Nov 23, 2023
994262f
fix providers in exports in deletion module
sszafGCA Nov 23, 2023
72e7f31
split deletion module and deletion-api.module
sszafGCA Nov 23, 2023
86b176d
move setup sessions to server config
sszafGCA Nov 23, 2023
e336196
try to fix test coverage
sszafGCA Nov 23, 2023
235a83c
Revert "try to fix test coverage"
sszafGCA Nov 23, 2023
e4b133d
Revert "move setup sessions to server config"
sszafGCA Nov 23, 2023
0cd52ca
remove api key from default.json
sszafGCA Nov 23, 2023
d86d1e5
changes to server module
sszafGCA Nov 24, 2023
41fcd0c
use timers in tests
sszafGCA Nov 24, 2023
a254858
revert last commit
sszafGCA Nov 24, 2023
4892112
Merge branch 'main' into BC-5522-impl-of-deletion-api
sszafGCA Nov 24, 2023
fe26bb0
add testXApiKeyClient
WojciechGrancow Nov 27, 2023
fce93f5
merge with main
WojciechGrancow Nov 27, 2023
bb48803
deployment impl
sszafGCA Nov 27, 2023
ee6c312
add newlines
sszafGCA Nov 27, 2023
7c229e2
add test
WojciechGrancow Nov 27, 2023
49f82f5
Merge branch 'main' into BC-5522-impl-of-deletion-api
WojciechGrancow Nov 27, 2023
2c37383
change character length
sszafGCA Nov 27, 2023
d98d11c
fix imports
WojciechGrancow Nov 27, 2023
fc41e5f
fix deployment in PR
WojciechGrancow Nov 27, 2023
eea9009
PR fixes part 1
sszafGCA Nov 28, 2023
ed55cdb
fix build and push
sszafGCA Nov 28, 2023
53905bb
fix prettier
sszafGCA Nov 28, 2023
2496a8b
default schema changes
sszafGCA Nov 28, 2023
787ab34
small fixes
WojciechGrancow Nov 28, 2023
c0567ff
Merge remote-tracking branch 'origin' into BC-5522-impl-of-deletion-api
WojciechGrancow Nov 28, 2023
1d53580
fix lint
sszafGCA Nov 28, 2023
084e46e
Merge branch 'main' into BC-5522-impl-of-deletion-api
sszafGCA Nov 28, 2023
228ab7a
add registration pins module
sszafGCA Nov 28, 2023
6590fc0
change sorting of code lines
CeEv Nov 29, 2023
9d98975
small fixes after review
WojciechGrancow Nov 29, 2023
02e37c8
add enabled in admiApiServer
WojciechGrancow Nov 29, 2023
df06ed7
add process.exit
WojciechGrancow Nov 29, 2023
b2fa12f
test revert enabled (testing purposes)
sszafGCA Nov 29, 2023
bc3faa1
Revert "test revert enabled (testing purposes)"
sszafGCA Nov 29, 2023
d589435
add default for testers
sszafGCA Nov 29, 2023
9d6e7c8
Revert "add default for testers"
sszafGCA Nov 29, 2023
a13fc2d
fix with elsson entity
WojciechGrancow Nov 29, 2023
760190d
Merge branch 'main' into BC-5522-impl-of-deletion-api
WojciechGrancow Nov 29, 2023
25b15c6
Merge branch 'BC-5522-impl-of-deletion-api' of https://github.com/hpi…
WojciechGrancow Nov 29, 2023
499d22b
fix lint
sszafGCA Nov 30, 2023
fcacb61
Merge branch 'main' into BC-5522-impl-of-deletion-api
sszafGCA Nov 30, 2023
7e75f2b
changes in main.yml
sszafGCA Nov 30, 2023
e482fd6
Merge branch 'main' into BC-5522-impl-of-deletion-api
sszafGCA Nov 30, 2023
1d41b33
fix enabled
WojciechGrancow Nov 30, 2023
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
Prev Previous commit
Next Next commit
api impl
sszafGCA committed Nov 10, 2023
commit fd2b9b819637974bc9c08aa44fee4b8141f48c9f
28 changes: 28 additions & 0 deletions apps/server/src/apps/helpers/admin-api-setup-helper.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import express from 'express';
import { Configuration } from '@hpi-schul-cloud/commons/lib';
import { Logger } from '@src/core/logger';
import { AdminApiServerModule } from '@src/modules/server/admin-api.server.module';
import { ExpressAdapter } from '@nestjs/platform-express';
import { NestFactory } from '@nestjs/core';
import { AppStartLoggable } from './app-start-loggable';

export const createAndStartAdminApiServer = async (logger: Logger) => {
const nestAdminServerExpress = express();
const nestAdminServerExpressAdapter = new ExpressAdapter(nestAdminServerExpress);
const nestAdminServerApp = await NestFactory.create(AdminApiServerModule, nestAdminServerExpressAdapter);

nestAdminServerApp.setGlobalPrefix('/admin/api/v1');
await nestAdminServerApp.init();

const adminApiServerPort = Configuration.get('ADMIN_API__PORT') as number;

nestAdminServerExpress.listen(adminApiServerPort, () => {
logger.info(
new AppStartLoggable({
appName: 'Admin Api server app',
port: adminApiServerPort,
mountsDescription: `/admin/api/v1 --> Admin Api Server`,
})
);
});
};
6 changes: 6 additions & 0 deletions apps/server/src/apps/server.app.ts
Original file line number Diff line number Diff line change
@@ -21,13 +21,15 @@ import { join } from 'path';
// register source-map-support for debugging
import { install as sourceMapInstall } from 'source-map-support';
import { FeathersRosterService } from '@modules/pseudonym';
import { Configuration } from '@hpi-schul-cloud/commons/lib';
import legacyAppPromise = require('../../../../src/app');

import { AppStartLoggable } from './helpers/app-start-loggable';
import {
addPrometheusMetricsMiddlewaresIfEnabled,
createAndStartPrometheusMetricsAppIfEnabled,
} from './helpers/prometheus-metrics';
import { createAndStartAdminApiServer } from './helpers/admin-api-setup-helper';

async function bootstrap() {
sourceMapInstall();
@@ -127,6 +129,10 @@ async function bootstrap() {
createAndStartPrometheusMetricsAppIfEnabled(logger);
});

if (Configuration.get('ADMIN_API__ENABLED') === true) {
await createAndStartAdminApiServer(logger);
}

console.log('#################################');
console.log(`### Start Server ###`);
console.log(`### Port: ${port} ###`);
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Body, Controller, Get, Param, Post, UseGuards } from '@nestjs/common';
import { Body, Controller, Delete, Get, Param, Post, UseGuards } from '@nestjs/common';
import { ApiOperation, ApiResponse, ApiTags } from '@nestjs/swagger';
import { ForbiddenOperationError, ValidationError } from '@shared/common';
import { AuthGuard } from '@nestjs/passport';
@@ -45,7 +45,7 @@ export class DeletionRequestsController {
return this.deletionRequestUc.findById(requestId);
}

@Get(':requestId')
@Delete(':requestId')
@ApiOperation({
summary: 'Canceling a deletion request',
})
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ApiProperty } from '@nestjs/swagger';
import { IsOptional } from 'class-validator/types/decorator/decorators';
import { IsOptional } from 'class-validator';
import { DeletionLogStatistic, DeletionTargetRef } from '../../uc/interface';
CeEv marked this conversation as resolved.
Show resolved Hide resolved

export class DeletionRequestLogResponse {
52 changes: 50 additions & 2 deletions apps/server/src/modules/deletion/deletion.module.ts
CeEv marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,17 +1,65 @@
import { Module } from '@nestjs/common';
import { LoggerModule } from '@src/core/logger';
import { ConfigService } from '@nestjs/config';
import { CourseGroupRepo } from '@shared/repo';
import { Configuration } from '@hpi-schul-cloud/commons';
import { DeletionRequestService } from './services/deletion-request.service';
import { DeletionRequestRepo } from './repo/deletion-request.repo';
import { AuthenticationModule } from '../authentication';
WojciechGrancow marked this conversation as resolved.
Show resolved Hide resolved
import { DeletionRequestsController } from './controller/deletion-requests.controller';
import { DeletionExecutionsController } from './controller/deletion-executions.controller';
import { IXApiKeyConfig } from '../authentication/config/x-api-key.config';
import { DeletionRequestUc } from './uc/deletion-request.uc';
import { DeletionLogService } from './services/deletion-log.service';
import { AccountModule } from '../account';
import { ClassModule } from '../class';
import { CourseGroupService } from '../learnroom/service';
import { LearnroomModule } from '../learnroom';
import { FilesService } from '../files/service';
import { LessonModule } from '../lesson';
import { PseudonymModule } from '../pseudonym';
import { TeamsModule } from '../teams';
import { UserModule } from '../user';
import { RocketChatUserService } from '../rocketchat-user';
import { RocketChatModule } from '../rocketchat';
import { DeletionLogRepo } from './repo';
import { FilesRepo } from '../files/repo';
import { RocketChatUserRepo } from '../rocketchat-user/repo';

@Module({
imports: [LoggerModule, AuthenticationModule],
imports: [
LoggerModule,
AuthenticationModule,
AccountModule,
ClassModule,
LearnroomModule,
LessonModule,
PseudonymModule,
TeamsModule,
UserModule,
RocketChatModule.forRoot({
uri: Configuration.get('ROCKET_CHAT_URI') as string,
adminId: Configuration.get('ROCKET_CHAT_ADMIN_ID') as string,
adminToken: Configuration.get('ROCKET_CHAT_ADMIN_TOKEN') as string,
adminUser: Configuration.get('ROCKET_CHAT_ADMIN_USER') as string,
adminPassword: Configuration.get('ROCKET_CHAT_ADMIN_PASSWORD') as string,
}),
],
controllers: [DeletionRequestsController, DeletionExecutionsController],
WojciechGrancow marked this conversation as resolved.
Show resolved Hide resolved
providers: [DeletionRequestService, DeletionRequestRepo, ConfigService<IXApiKeyConfig, true>],
providers: [
DeletionRequestService,
DeletionRequestRepo,
ConfigService<IXApiKeyConfig, true>,
DeletionRequestUc,
DeletionLogService,
CourseGroupService,
FilesService,
DeletionLogRepo,
CourseGroupRepo,
WojciechGrancow marked this conversation as resolved.
Show resolved Hide resolved
FilesRepo,
RocketChatUserService,
RocketChatUserRepo,
],
exports: [DeletionRequestService],
})
export class DeletionModule {}
48 changes: 48 additions & 0 deletions apps/server/src/modules/server/admin-api.server.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import { MikroOrmModule } from '@mikro-orm/nestjs';
import { Inject, MiddlewareConsumer, Module, NestModule } from '@nestjs/common';
import { ALL_ENTITIES } from '@shared/domain';
import { RabbitMQWrapperModule } from '@infra/rabbitmq';
import { RedisModule, REDIS_CLIENT } from '@infra/redis';
import { DB_PASSWORD, DB_URL, DB_USERNAME, createConfigModuleOptions } from '@src/config';
import { LegacyLogger, LoggerModule } from '@src/core/logger';
import { RedisClient } from 'redis';
import { ConfigModule } from '@nestjs/config';
import { ServerController } from './controller/server.controller';
import { DeletionModule } from '../deletion';
import { defaultMikroOrmOptions, setupSessions } from './server.module';
import { serverConfig } from './server.config';

const serverModules = [ConfigModule.forRoot(createConfigModuleOptions(serverConfig)),DeletionModule];

Check failure on line 15 in apps/server/src/modules/server/admin-api.server.module.ts

GitHub Actions / nest_lint

Insert `·`

@Module({
imports: [
RabbitMQWrapperModule,
...serverModules,
MikroOrmModule.forRoot({
...defaultMikroOrmOptions,
type: 'mongo',
// TODO add mongoose options as mongo options (see database.js)
clientUrl: DB_URL,
password: DB_PASSWORD,
user: DB_USERNAME,
entities: ALL_ENTITIES,

// debug: true, // use it for locally debugging of queries
}),
LoggerModule,
RedisModule,
],
controllers: [ServerController],
})
export class AdminApiServerModule implements NestModule {
constructor(
@Inject(REDIS_CLIENT) private readonly redisClient: RedisClient | undefined,
private readonly logger: LegacyLogger
) {
logger.setContext(AdminApiServerModule.name);
}

configure(consumer: MiddlewareConsumer) {
setupSessions(consumer, this.redisClient, this.logger);
}
}
7 changes: 4 additions & 3 deletions apps/server/src/modules/server/server.config.ts
Original file line number Diff line number Diff line change
@@ -43,12 +43,13 @@
FEATURE_IDENTITY_MANAGEMENT_ENABLED: Configuration.get('FEATURE_IDENTITY_MANAGEMENT_ENABLED') as boolean,
FEATURE_IDENTITY_MANAGEMENT_STORE_ENABLED: Configuration.get('FEATURE_IDENTITY_MANAGEMENT_STORE_ENABLED') as boolean,
FEATURE_IDENTITY_MANAGEMENT_LOGIN_ENABLED: Configuration.get('FEATURE_IDENTITY_MANAGEMENT_LOGIN_ENABLED') as boolean,
ADDITIONAL_BLACKLISTED_EMAIL_DOMAINS: (Configuration.get('ADDITIONAL_BLACKLISTED_EMAIL_DOMAINS') as string)
.split(',')
.map((domain) => domain.trim()),
ADMIN_API__ALLOWED_API_KEYS: (Configuration.get('ADMIN_API__ALLOWED_API_KEYS') as string)
.split(',')
.map((apiKey) => apiKey.trim()),
ADDITIONAL_BLACKLISTED_EMAIL_DOMAINS: (Configuration.get('ADDITIONAL_BLACKLISTED_EMAIL_DOMAINS') as string)
.split(',')
.map((domain) => domain.trim()),

Check failure on line 52 in apps/server/src/modules/server/server.config.ts

GitHub Actions / nest_lint

Delete `↹⏎`
WojciechGrancow marked this conversation as resolved.
Show resolved Hide resolved
};

export const serverConfig = () => config;
6 changes: 5 additions & 1 deletion apps/server/src/modules/server/server.module.ts
Original file line number Diff line number Diff line change
@@ -87,7 +87,11 @@ export const defaultMikroOrmOptions: MikroOrmModuleSyncOptions = {
new NotFoundException(`The requested ${entityName}: ${where} has not been found.`),
};

const setupSessions = (consumer: MiddlewareConsumer, redisClient: RedisClient | undefined, logger: LegacyLogger) => {
export const setupSessions = (
consumer: MiddlewareConsumer,
redisClient: RedisClient | undefined,
logger: LegacyLogger
) => {
const sessionDuration: number = Configuration.get('SESSION__EXPIRES_SECONDS') as number;
WojciechGrancow marked this conversation as resolved.
Show resolved Hide resolved

let store: connectRedis.RedisStore | undefined;
3 changes: 3 additions & 0 deletions config/default.json
Original file line number Diff line number Diff line change
@@ -41,5 +41,8 @@
},
"CTL_TOOLS": {
"EXTERNAL_TOOL_MAX_LOGO_SIZE_IN_BYTES": 300000
},
"ADMIN_API": {
"ENABLED": true
}
}
41 changes: 21 additions & 20 deletions config/default.schema.json
Original file line number Diff line number Diff line change
@@ -1267,6 +1267,27 @@
"default": false,
"description": "Enables feature that allows the insecure LDAP URL (with ldap:// protocol)."
},
"ADMIN_API": {
"type": "object",
"description": "Configuration of the schulcloud-server's admin API.",
"properties": {
"ENABLED": {
"type": "boolean",
"default": true,
"description": "Flag to turn on/off the Admin API."
},
"PORT": {
"type": "number",
"default": 4030,
"description": "Port of the exposed Admin API server."
},
"ALLOWED_API_KEYS": {
"type": "string",
"default": "",
"description": "Allowed Admin API keys (for accessing the Admin API)."
}
}
},
"FEATURE_NEW_SCHOOL_ADMINISTRATION_PAGE_AS_DEFAULT_ENABLED": {
"type": "boolean",
"default": false,
@@ -1410,26 +1431,6 @@
"SECRET_ES_MERLIN_COUNTIES_CREDENTIALS"
]
}
},
"ADMIN_API": {
"type": "object",
"description": "Configuration of the schulcloud-server's admin API.",
"properties": {
"ENABLED": {
"type": "boolean",
"default": true,
"description": "Flag to turn on/off the Admin API."
},
"PORT": {
"type": "number",
"default": 4030,
"description": "Port of the exposed Admin API server."
},
"ALLOWED_API_KEYS": {
"type": "string",
"description": "Allowed Admin API keys (for accessing the Admin API)."
}
}
}
}
}

Unchanged files with check annotations Beta

describe('GlobalErrorFilter', () => {
let module: TestingModule;
let service: GlobalErrorFilter<any>;

Check warning on line 66 in apps/server/src/core/error/filter/global-error.filter.spec.ts

GitHub Actions / nest_lint

Unexpected any. Specify a different type
let logger: DeepMocked<ErrorLogger>;
beforeAll(async () => {
return stringifiedMessage;
}
static isInstanceOfLoggable(object: any): object is Loggable {

Check warning on line 18 in apps/server/src/core/logger/logging.utils.ts

GitHub Actions / nest_lint

Unexpected any. Specify a different type
return 'getLogMessage' in object;
}
}
],
}).compile();
adapter = module.get(CollaborativeStorageAdapter);
strategy = adapter.strategy;

Check warning on line 59 in apps/server/src/infra/collaborative-storage/collaborative-storage.adapter.spec.ts

GitHub Actions / nest_lint

Use object destructuring
});
afterEach(() => {
storageProviderRepo.findAll.mockResolvedValueOnce([storageProvider]);
const spy = jest.spyOn(DeleteFilesUc.prototype as any, 'deleteFileInStorage');

Check warning on line 122 in apps/server/src/modules/files/uc/delete-files.uc.spec.ts

GitHub Actions / nest_lint

Unexpected any. Specify a different type
spy.mockRejectedValueOnce(error);
return { thresholdDate, batchSize, error, spy };
describe('when compare library Version', () => {
it('should call compareVersions', () => {
const compareVersionsSpy = (
jest.spyOn(addonLibVersionOne, 'compareVersions') as jest.SpyInstance<any, any>

Check warning on line 139 in apps/server/src/modules/h5p-editor/entity/library.entity.spec.ts

GitHub Actions / nest_lint

Unexpected any. Specify a different type

Check warning on line 139 in apps/server/src/modules/h5p-editor/entity/library.entity.spec.ts

GitHub Actions / nest_lint

Unexpected any. Specify a different type
).mockReturnValueOnce(0);
addonLibVersionOne.compare(addonLibVersionOne);
expect(compareVersionsSpy).toHaveBeenCalled();
oauthAdapterService.getPublicKey.mockResolvedValue('publicKey');
oauthAdapterService.sendAuthenticationCodeTokenRequest.mockResolvedValue(oauthTokenResponse);
const result: OAuthTokenDto = await service.authenticateUser(system.id!, 'redirectUri', authCode);

Check warning on line 289 in apps/server/src/modules/oauth/service/oauth.service.spec.ts

GitHub Actions / nest_lint

Forbidden non-null assertion
expect(result).toEqual<OAuthTokenDto>({
accessToken: oauthTokenResponse.access_token,
const setup = () => {
const { sanisResponse } = setupSanisResponse();
const personenkontext: SanisPersonenkontextResponse = sanisResponse.personenkontexte[0];
const group: SanisGruppenResponse = personenkontext.gruppen![0];

Check warning on line 156 in apps/server/src/modules/provisioning/strategy/sanis/sanis-response.mapper.spec.ts

GitHub Actions / nest_lint

Forbidden non-null assertion
return {
sanisResponse,
const result: ExternalGroupDto[] | undefined = mapper.mapToExternalGroupDtos(sanisResponse);
expect(result![0]).toEqual<ExternalGroupDto>({

Check warning on line 170 in apps/server/src/modules/provisioning/strategy/sanis/sanis-response.mapper.spec.ts

GitHub Actions / nest_lint

Forbidden non-null assertion
name: group.gruppe.bezeichnung,
type: GroupTypes.CLASS,
externalOrganizationId: personenkontext.organisation.id,
describe('when no group type is provided', () => {
const setup = () => {
const { sanisResponse } = setupSanisResponse();
sanisResponse.personenkontexte[0].gruppen![0]!.gruppe.typ = SanisGroupType.OTHER;

Check warning on line 190 in apps/server/src/modules/provisioning/strategy/sanis/sanis-response.mapper.spec.ts

GitHub Actions / nest_lint

Forbidden non-null assertion
return {
sanisResponse,