refactor: include latest changes from core#145

This commit is contained in:
Rainer Killinger
2022-01-21 15:30:23 +01:00
parent 482dec345c
commit 9d8fe643a5
13 changed files with 316 additions and 260 deletions

View File

@@ -2,25 +2,33 @@
// tslint:disable:no-magic-numbers
import {SCConfigFile} from '@openstapps/core';
import {RecursivePartial} from '@openstapps/logger/lib/common';
import moment from 'moment';
import {inRangeInclusive} from '../src/common';
const ssRange = [4, 9];
const wsRange = [10, 3];
const month = moment()
.month();
const year = moment()
.year();
const wsYearOffset = (month < wsRange[0] ? -1 : 0);
const wsAcronym = `WS ${year + wsYearOffset}/${(year + 1 + wsYearOffset)
.toString()
.slice(-2)}`;
const ssAcronym = `SS ${year + (month <= wsRange[1] ? -1 : 0)}`;
/**
* This is the default configuration for the technical university of Berlin
* This is the default configuration for the Goethe university of Frankfurt
*/
const config: RecursivePartial<SCConfigFile> = {
auth: {
default: {
client: {
clientId: '1cac3f99-33fa-4234-8438-979f07e0cdab',
scopes: '',
url: 'https://cas.rz.uni-frankfurt.de/cas/oauth2.0',
},
endpoints: {
authorization: 'https://cas.rz.uni-frankfurt.de/cas/oauth2.0/authorize',
mapping: {
id: '$.id',
email: '$.attributes.mailPrimaryAddress',
familyName: '$.attributes.sn',
name: '$.attributes.givenName',
role: '$.attributes.eduPersonPrimaryAffiliation',
studentId: '$.attributes.employeeNumber',
},
token: 'https://cas.rz.uni-frankfurt.de/cas/oauth2.0/accessToken',
userinfo: 'https://cas.rz.uni-frankfurt.de/cas/oauth2.0/profile',
},
},
},
internal: {
boostings: {
default: [
@@ -28,8 +36,8 @@ const config: RecursivePartial<SCConfigFile> = {
factor: 1,
fields: {
'academicTerms.acronym': {
[ssAcronym]: inRangeInclusive(month, ssRange) ? 1.1 : 1.05,
[wsAcronym]: inRangeInclusive(month, wsRange) ? 1.1 : 1.05,
'SS 2022': 1.05,
'WS 2021/2022': 1.1,
},
},
},

View File

@@ -362,7 +362,6 @@ const config: Partial<SCConfigFile> = {
type: 'Polygon',
},
features: {
widgets: true,
},
menus: [
{
@@ -533,6 +532,25 @@ const config: Partial<SCConfigFile> = {
languageSetting,
],
},
auth: {
paia: {
client: {
clientId: '',
scopes: '',
url: 'https://hds.hebis.de/Shibboleth.sso/UBFFM?target=https://hds.hebis.de/ubffm/paia_login_stub.php',
},
endpoints: {
authorization: 'https://hds.hebis.de/Shibboleth.sso/UBFFM?target=https://hds.hebis.de/ubffm/paia_login_stub.php',
mapping: {
id: '$.email',
name: '$.name',
role: '$.type',
},
token: 'https://hds.hebis.de:8443/auth/login',
userinfo: 'https://hds.hebis.de:8443/core',
},
},
},
backend: {
SCVersion: JSON.parse((readFileSync(resolve('.', '.', 'package.json'), 'utf-8')).toString())
.dependencies['@openstapps/core'],