diff --git a/src/api/auth/auth.middlewares.js b/src/api/auth/auth.middlewares.js index 5878559d..c5f93745 100644 --- a/src/api/auth/auth.middlewares.js +++ b/src/api/auth/auth.middlewares.js @@ -62,7 +62,7 @@ export const signin = async (req, res, next) => { const { password: _password } = user; const isMatch = await bcrypt.compare(password, _password); if (!isMatch) throw new BadRequestError('Mauvaise combinaison utilisateur/mot de passe'); - totp.options = { window: [20, 0] }; + totp.options = { window: [60, 0] }; if (!userOtp) { res.setHeader(otpHeader, 'required'); res.setHeader(otpMethodHeader, 'email;'); @@ -70,7 +70,7 @@ export const signin = async (req, res, next) => { const otp = totp.generate(user.otpSecret); const ip = req.headers['x-forwarded-for'] || req.socket.remoteAddress; agenda.now('send signin email', { user, otp, ip }); - const expires = new Date().setMinutes(new Date().getMinutes() + 10); + const expires = new Date().setMinutes(new Date().getMinutes() + 15); const options = { year: 'numeric', month: 'long', @@ -138,7 +138,7 @@ export const resetPassword = async (req, res, next) => { const otpMethod = req.headers[otpMethodHeader]; const user = await usersRepository.getByEmail(email); if (!user) throw new NotFoundError(); - totp.options = { window: [20, 0] }; + totp.options = { window: [60, 0] }; if (!userOtp) { res.setHeader(otpHeader, 'required'); res.setHeader(otpMethodHeader, 'email;'); @@ -146,7 +146,7 @@ export const resetPassword = async (req, res, next) => { const otp = totp.generate(user.otpSecret); const ip = req.headers['x-forwarded-for'] || req.socket.remoteAddress; agenda.now('send recovery email', { user, otp, ip }); - const expires = new Date().setMinutes(new Date().getMinutes() + 10); + const expires = new Date().setMinutes(new Date().getMinutes() + 15); const options = { year: 'numeric', month: 'long', diff --git a/src/api/commons/queries/structures.elastic.js b/src/api/commons/queries/structures.elastic.js index a8a975ba..b62a539d 100644 --- a/src/api/commons/queries/structures.elastic.js +++ b/src/api/commons/queries/structures.elastic.js @@ -12,7 +12,7 @@ export default [ $match: { $expr: { $and: [ - { $in: ['$type', ['GRID', 'idRef', 'RNSR', 'ROR', 'Siret', 'UAI', 'Wikidata']] }, + { $in: ['$type', ['finess', 'GRID', 'idRef', 'ringgold', 'RNSR', 'ROR', 'Siret', 'UAI', 'Wikidata']] }, ], }, }, diff --git a/src/api/persons/__tests__/identifiers.test.js b/src/api/persons/__tests__/identifiers.test.js index 8d8796f6..7b11e4ff 100644 --- a/src/api/persons/__tests__/identifiers.test.js +++ b/src/api/persons/__tests__/identifiers.test.js @@ -179,8 +179,8 @@ describe('API > persons > identifiers > list', () => { .post(`/${resource}/${resourceId}/${subresource}/`) .set('Authorization', authorization) .send({ - type: 'Siret', - value: 'siretID', + type: 'scopus', + value: 'scopusID', active: true, startDate: '2012-01-01', endDate: '2014-12-31', @@ -200,7 +200,7 @@ describe('API > persons > identifiers > list', () => { .set('Authorization', authorization) .send({ type: 'idRef', - value: 'idrefID', + value: 'idRefID', active: true, startDate: '2012-01-01', endDate: '2014-12-31', @@ -221,7 +221,7 @@ describe('API > persons > identifiers > list', () => { .set('Authorization', authorization); const docs = body.data.map((doc) => doc.type); expect(docs).toHaveLength(3); - expect(docs).toContain('Siret'); + expect(docs).toContain('scopus'); expect(docs).toContain('Wikidata'); expect(docs).toContain('idRef'); }); diff --git a/src/api/search/search.routes.js b/src/api/search/search.routes.js index 95aadd5e..319f69d0 100644 --- a/src/api/search/search.routes.js +++ b/src/api/search/search.routes.js @@ -80,7 +80,7 @@ router.route('/autocomplete') default_operator: 'AND', fields: ['acronym', 'acronymFr', 'acronymEn', 'acronymLocal', 'brandName', 'category', 'city', 'firstName', 'id', 'identifiers', 'lastName', 'locality', 'name', 'nameEn', 'names', 'names.acronymFr', 'names.id', 'names.nameEn', 'names.officialName', - 'names.otherNames', 'names.shortName', 'names.usualName', 'officialName', 'otherNames', 'shortName'], + 'names.otherNames', 'names.shortName', 'names.usualName', 'officialName', 'otherNames', 'otherNamesEn', 'otherNamesFr', 'shortName'], }, }, { query_string: { @@ -88,7 +88,7 @@ router.route('/autocomplete') default_operator: 'AND', fields: ['acronym', 'acronymFr', 'acronymEn', 'acronymLocal', 'brandName', 'category', 'city', 'firstName', 'id', 'identifiers', 'lastName', 'locality', 'name', 'nameEn', 'names', 'names.acronymFr', 'names.id', 'names.nameEn', 'names.officialName', - 'names.otherNames', 'names.shortName', 'names.usualName', 'officialName', 'otherNames', 'shortName'], + 'names.otherNames', 'names.shortName', 'names.usualName', 'officialName', 'otherNames', 'otherNamesEn', 'otherNamesFr', 'shortName'], }, }], }, diff --git a/src/openapi/parameters/ids/dataset.yml b/src/openapi/parameters/ids/dataset.yml index 4f3542fd..7ef2db7a 100644 --- a/src/openapi/parameters/ids/dataset.yml +++ b/src/openapi/parameters/ids/dataset.yml @@ -2,6 +2,6 @@ name: dataset in: path schema: type: string - enum: ["biatss", "education", "finance", "master", "master-mentions", "population", "real-estate"] + enum: ["biatss", "education", "finance", "inserpro", "master", "master-mentions", "piaweb", "piaweb-paysage", "population", "population-statistics", "real-estate", "tmm-mentions", "tmm-trainings", "tranings"] required: true description: Dataset name to collect the keynumbers \ No newline at end of file diff --git a/src/openapi/schemas/persons/enums/identifier-types.yml b/src/openapi/schemas/persons/enums/identifier-types.yml index 4617fb19..3674252b 100644 --- a/src/openapi/schemas/persons/enums/identifier-types.yml +++ b/src/openapi/schemas/persons/enums/identifier-types.yml @@ -1,33 +1,13 @@ description: Accepted values of identifier type for a person type: string enum: - - Code Insee - - cvHal - - dataESR - - fundref - - GA OAD - - GRID - - Id unité CNRS - Identifiant BnF - - Identifiant CTI de l'école - idHal - idRef - - ISIL - isni - - Numéro d'ED - Numéro national de Thèse - - OpenCorporates ID - ORCID Id - - orgref - - PIC (Participant Identification Code) - - RCR - - Référence projet PIA (ANR) - - RNA - - ROR - - Siret - - These - - UAI + - scopus - Univ-droit jurist ID - - Web of Science Researcher ID - Wikidata - WOS \ No newline at end of file diff --git a/src/openapi/schemas/structures/enums/identifier-types.yml b/src/openapi/schemas/structures/enums/identifier-types.yml index 77c224a0..6cb21214 100644 --- a/src/openapi/schemas/structures/enums/identifier-types.yml +++ b/src/openapi/schemas/structures/enums/identifier-types.yml @@ -2,11 +2,9 @@ description: Accepted values of identifier type for a structure type: string enum: - BibId - - Code Insee - - dataESR - - ESGBU - ETER - EtId + - finess - fundref - GA OAD - GRID @@ -19,22 +17,16 @@ enum: - ISIL - isni - Numéro d'ED - - Numéro national de Thèse - - OAD - - OC - OpenCorporates ID - - ORCID Id - orgref - PIC (Participant Identification Code) - RCR - Référence projet PIA (ANR) + - ringgold - RNA - RNSR - ROR - SdId - Siret - UAI - - Univ-droit jurist ID - - Web of Science Researcher ID - Wikidata - - WOS \ No newline at end of file