Skip to content

Commit

Permalink
review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
MarvinOehlerkingCap committed Dec 13, 2024
1 parent 56b36ba commit fc8ae4a
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 128 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import { ErrorLogMessage, Loggable, LogMessage, ValidationErrorLogMessage } from '@src/core/logger';
import { ExternalGroupDto, ExternalUserDto } from '../dto';
import { ExternalGroupDto } from '../dto';

export class GroupProvisioningInfoLoggable implements Loggable {
constructor(
private readonly groupUser: ExternalUserDto,
private readonly groups: ExternalGroupDto[],
private readonly durationMs: number
) {}
constructor(private readonly groups: ExternalGroupDto[], private readonly durationMs: number) {}

public getLogMessage(): LogMessage | ErrorLogMessage | ValidationErrorLogMessage {
const userCount = this.groups.reduce(
Expand All @@ -17,7 +13,6 @@ export class GroupProvisioningInfoLoggable implements Loggable {
return {
message: 'Group provisioning has finished.',
data: {
externalUserId: this.groupUser.externalId,
groupCount: this.groups.length,
userCount,
durationMs: this.durationMs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,7 @@ export abstract class SchulconnexProvisioningStrategy extends ProvisioningStrate
}

const endTime = performance.now();
this.logger.warning(
new GroupProvisioningInfoLoggable(data.externalUser, data.externalGroups ?? [], endTime - startTime)
);
this.logger.warning(new GroupProvisioningInfoLoggable(data.externalGroups ?? [], endTime - startTime));
}

private async removeUserFromGroups(data: OauthDataDto): Promise<void> {
Expand Down
139 changes: 21 additions & 118 deletions config/default.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,7 @@
},
"NODE_ENV": {
"type": "string",
"enum": [
"development",
"test",
"production",
"migration"
],
"enum": ["development", "test", "production", "migration"],
"default": "production"
},
"REQUEST_OPTION": {
Expand Down Expand Up @@ -77,10 +72,7 @@
"DEFAULT_LANGUAGE": {
"type": "string",
"default": "de",
"enum": [
"de",
"en"
],
"enum": ["de", "en"],
"description": "Value for the default language"
},
"DEFAULT_TIMEZONE": {
Expand Down Expand Up @@ -108,23 +100,13 @@
"TEACHER_VISIBILITY_FOR_EXTERNAL_TEAM_INVITATION": {
"type": "string",
"default": "disabled",
"enum": [
"disabled",
"opt-in",
"opt-out",
"enabled"
],
"enum": ["disabled", "opt-in", "opt-out", "enabled"],
"description": "defines wheter external team invitation shows teachers from different schools or not. if enabled system wide there are options general enabled or opt-in/-out by user required."
},
"STUDENT_TEAM_CREATION": {
"type": "string",
"default": "opt-out",
"enum": [
"disabled",
"opt-in",
"opt-out",
"enabled"
],
"enum": ["disabled", "opt-in", "opt-out", "enabled"],
"description": "defines wheter students may create teams or not. if enabled system wide there are options general enabled or opt-in/-out by school admin required."
},
"REDIS_URI": {
Expand Down Expand Up @@ -300,13 +282,7 @@
"FILES_STORAGE": {
"type": "object",
"description": "Files storage server properties, required always to be defined",
"required": [
"S3_ENDPOINT",
"S3_REGION",
"S3_BUCKET",
"S3_ACCESS_KEY_ID",
"S3_SECRET_ACCESS_KEY"
],
"required": ["S3_ENDPOINT", "S3_REGION", "S3_BUCKET", "S3_ACCESS_KEY_ID", "S3_SECRET_ACCESS_KEY"],
"properties": {
"SERVICE_BASE_URL": {
"type": "string",
Expand Down Expand Up @@ -363,13 +339,7 @@
"FWU_CONTENT": {
"type": "object",
"description": "Properties of the S3 storage containing FWU content",
"required": [
"S3_ENDPOINT",
"S3_REGION",
"S3_BUCKET",
"S3_ACCESS_KEY",
"S3_SECRET_KEY"
],
"required": ["S3_ENDPOINT", "S3_REGION", "S3_BUCKET", "S3_ACCESS_KEY", "S3_SECRET_KEY"],
"properties": {
"S3_ENDPOINT": {
"type": "string",
Expand Down Expand Up @@ -408,12 +378,7 @@
"H5P_EDITOR": {
"type": "object",
"description": "Properties of the H5P server microservice and library management job",
"required": [
"S3_ENDPOINT",
"S3_REGION",
"S3_BUCKET_CONTENT",
"S3_BUCKET_LIBRARIES"
],
"required": ["S3_ENDPOINT", "S3_REGION", "S3_BUCKET_CONTENT", "S3_BUCKET_LIBRARIES"],
"default": {},
"properties": {
"S3_ENDPOINT": {
Expand Down Expand Up @@ -473,12 +438,7 @@
"H5P_Library": {
"type": "object",
"description": "Properties of the H5P server microservice",
"required": [
"S3_ENDPOINT",
"S3_BUCKET_LIBRARIES",
"S3_ACCESS_KEY_ID",
"S3_SECRET_ACCESS_KEY"
],
"required": ["S3_ENDPOINT", "S3_BUCKET_LIBRARIES", "S3_ACCESS_KEY_ID", "S3_SECRET_ACCESS_KEY"],
"default": {},
"properties": {
"S3_ENDPOINT": {
Expand Down Expand Up @@ -912,9 +872,7 @@
"ETHERPAD": {
"type": "object",
"description": "Etherpad settings",
"required": [
"PAD_URI"
],
"required": ["PAD_URI"],
"properties": {
"URI": {
"type": "string",
Expand Down Expand Up @@ -1072,9 +1030,7 @@
"API_VALIDATION_WHITELIST_EXTENSION": {
"type": "string",
"description": "when set, this is interpreted as a regex to extend the ignorelist for the API validation with any routes matching the regex.",
"examples": [
".*/courses/[0-9a-f]{24}($|/$)"
]
"examples": [".*/courses/[0-9a-f]{24}($|/$)"]
},
"FEATURE_PROMETHEUS_METRICS_ENABLED": {
"type": "boolean",
Expand Down Expand Up @@ -1149,31 +1105,13 @@
"type": "string",
"default": "error",
"description": "Log level for api.",
"enum": [
"emerg",
"alert",
"crit",
"error",
"warning",
"notice",
"info",
"debug"
]
"enum": ["emerg", "alert", "crit", "error", "warning", "notice", "info", "debug"]
},
"NEST_LOG_LEVEL": {
"type": "string",
"default": "notice",
"description": "Nest Log level for api. The http flag is for request logging. The http flag do only work by api methods with added 'request logging interceptor'.",
"enum": [
"emerg",
"alert",
"crit",
"error",
"warning",
"notice",
"info",
"debug"
]
"enum": ["emerg", "alert", "crit", "error", "warning", "notice", "info", "debug"]
},
"EXIT_ON_ERROR": {
"type": "boolean",
Expand All @@ -1184,12 +1122,7 @@
"type": "string",
"default": "requestError",
"description": "Special logs.",
"enum": [
"requestError",
"systemLogs",
"request",
"sendRequests"
]
"enum": ["requestError", "systemLogs", "request", "sendRequests"]
},
"SYNC_QUEUE_NAME": {
"type": "string",
Expand Down Expand Up @@ -1376,11 +1309,7 @@
"SAME_SITE": {
"type": "string",
"default": "none",
"enum": [
"none",
"lax",
"strict"
],
"enum": ["none", "lax", "strict"],
"description": "Value for cookies sameSite property. When SECURE flag is false, 'None' is not allowed in SAME_SITE and Lax should be used as default instead"
},
"HTTP_ONLY": {
Expand All @@ -1404,13 +1333,7 @@
"description": "Expiration in seconds from now"
}
},
"required": [
"SAME_SITE",
"HTTP_ONLY",
"HOST_ONLY",
"SECURE",
"EXPIRES_SECONDS"
],
"required": ["SAME_SITE", "HTTP_ONLY", "HOST_ONLY", "SECURE", "EXPIRES_SECONDS"],
"allOf": [
{
"$ref": "#/properties/COOKIE/definitions/SAME_SITE_SECURE_VALID"
Expand All @@ -1428,10 +1351,7 @@
"then": {
"properties": {
"SAME_SITE": {
"enum": [
"lax",
"strict"
]
"enum": ["lax", "strict"]
}
}
}
Expand Down Expand Up @@ -1703,9 +1623,7 @@
"type": "string",
"default": "image/png,image/jpeg,image/gif,image/svg+xml",
"description": "List with allowed assets MIME types, comma separated, empty if all MIME types supported by tldraw should be allowed",
"examples": [
"image/gif,image/jpeg,video/webm"
]
"examples": ["image/gif,image/jpeg,video/webm"]
},
"PERFORMANCE_MEASURE_ENABLED": {
"type": "boolean",
Expand All @@ -1716,16 +1634,7 @@
"type": "string",
"default": "info",
"description": "Define log level for tldraw.",
"enum": [
"emerg",
"alert",
"crit",
"error",
"warning",
"notice",
"info",
"debug"
]
"enum": ["emerg", "alert", "crit", "error", "warning", "notice", "info", "debug"]
}
}
},
Expand All @@ -1746,16 +1655,12 @@
"API_URL": {
"type": "string",
"description": "Base URL of the schulconnex API (from dof)",
"examples": [
"https://api-dienste.stage.niedersachsen-login.schule/v1/"
]
"examples": ["https://api-dienste.stage.niedersachsen-login.schule/v1/"]
},
"TOKEN_ENDPOINT": {
"type": "string",
"description": "Token endpoint of the schulconnex API (from dof)",
"examples": [
"https://api-dienste.stage.niedersachsen-login.schule/v1/oauth2/token"
]
"examples": ["https://api-dienste.stage.niedersachsen-login.schule/v1/oauth2/token"]
},
"CLIENT_ID": {
"type": "string",
Expand Down Expand Up @@ -1831,9 +1736,7 @@
"type": "string",
"default": "",
"description": "URL for fetching policies info from moin.schule schulconnex",
"examples": [
"https://api-dienste.stage.niedersachsen-login.schule/v1/policies-info"
]
"examples": ["https://api-dienste.stage.niedersachsen-login.schule/v1/policies-info"]
},
"PROVISIONING_SCHULCONNEX_GROUP_USERS_LIMIT": {
"type": "number",
Expand Down

0 comments on commit fc8ae4a

Please sign in to comment.