diff --git a/features/run-kuzzle-stack.sh b/features/run-kuzzle-stack.sh index c4d78fbd..7dc9f13c 100755 --- a/features/run-kuzzle-stack.sh +++ b/features/run-kuzzle-stack.sh @@ -4,7 +4,7 @@ set -e # Create the folder where will be stored snapshots mkdir -p /tmp/snapshots -# chmod 777 -R /tmp/snapshots +chmod 777 -R /tmp/snapshots # Launch the kuzzle stack docker compose -f features/docker/docker-compose.yml up -d diff --git a/features/step_definitions/common/collection-steps.js b/features/step_definitions/common/collection-steps.js index 14483057..bb0f015f 100644 --- a/features/step_definitions/common/collection-steps.js +++ b/features/step_definitions/common/collection-steps.js @@ -31,7 +31,6 @@ Given( try { await this.sdk.security.getUser(userId); } catch (error) { - console.log('✔ User not found, creating...'); await this.sdk.security.createUser(userId, { content: { profileIds: ['default'] diff --git a/src/commands/app/scaffold.ts b/src/commands/app/scaffold.ts index 9067c11e..f39eec5b 100644 --- a/src/commands/app/scaffold.ts +++ b/src/commands/app/scaffold.ts @@ -62,7 +62,6 @@ export default class AppScaffold extends Kommand { } getRepo(flavor: string) { - console.log(flavor); switch (flavor) { case "generic": return "template-kuzzle-project"; diff --git a/src/common.ts b/src/common.ts index 486c3d55..70dafc37 100644 --- a/src/common.ts +++ b/src/common.ts @@ -165,7 +165,6 @@ export abstract class Kommand extends Command { this.logKo(`${e.document._id} : ${e.reason}`); } } else { - console.log(error); this.logKo(JSON.stringify(error.reason)); } diff --git a/src/support/kuzzle.ts b/src/support/kuzzle.ts index ae271fc8..2d4c62a7 100644 --- a/src/support/kuzzle.ts +++ b/src/support/kuzzle.ts @@ -153,7 +153,7 @@ export class KuzzleSDK { * @returns {void} */ public async impersonate(userKuid: string, callback: { (): Promise }) { - // const currentToken = this.sdk.jwt; + const currentToken = this.sdk.jwt; let apiKey: any; @@ -161,20 +161,18 @@ export class KuzzleSDK { apiKey = await this.security.createApiKey( userKuid, "Kourou impersonation token", - { expiresIn: "2h", refresh: false } as any + { expiresIn: "2h", refresh: "wait_for" } as any ); - console.log(`Impersonating user ${userKuid}...`, apiKey); - this.sdk.jwt = apiKey._source.token; await callback(); } finally { - // this.sdk.jwt = currentToken; + this.sdk.jwt = currentToken; - // if (apiKey?._id) { - // await this.security.deleteApiKey(userKuid, apiKey._id); - // } + if (apiKey?._id) { + await this.security.deleteApiKey(userKuid, apiKey._id); + } } }