Skip to content

Commit

Permalink
use checkAuthorization (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
ebrehault authored Mar 15, 2024
1 parent b5b926e commit 4bc6620
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 13 deletions.
4 changes: 2 additions & 2 deletions electron-app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion electron-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
},
"license": "MIT",
"dependencies": {
"@nuclia/core": "^1.11.6",
"@nuclia/core": "^1.14.2",
"cheerio": "^1.0.0-rc.12",
"commander": "^11.1.0",
"compression": "^1.7.4",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nuclia-sync-agent-app",
"version": "1.2.0",
"version": "1.2.1",
"description": "\"This is a Nuclia Sync Agent App\"",
"main": "build/index.js",
"scripts": {
Expand Down
4 changes: 4 additions & 0 deletions server/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 1.2.1 (2024-03-15)

- Use `checkAuthorization` to validate token

# 1.2.0 (2024-03-13)

- Secure endpoints by validating the dashboard user token
Expand Down
12 changes: 6 additions & 6 deletions server/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"start-server": "npm run compile && node build/start-file-system-server.js"
},
"dependencies": {
"@nuclia/core": "^1.13.0",
"@nuclia/core": "^1.14.2",
"cheerio": "^1.0.0-rc.12",
"commander": "^11.1.0",
"compression": "^1.7.4",
Expand Down
4 changes: 2 additions & 2 deletions server/src/logic/sync/domain/sync.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ export class SyncEntity {
const nuclia = new Nuclia({ ...this.kb, apiKey: '' });
nuclia.auth.authenticate({ access_token: token, refresh_token: '' });
const req = await firstValueFrom(
nuclia.knowledgeBox.getConfiguration().pipe(
map(() => true),
nuclia.rest.checkAuthorization(`/kb/${this.kb.knowledgeBox}/configure`).pipe(
map((check) => check.allowed),
catchError(() => of(false)),
),
);
Expand Down

0 comments on commit 4bc6620

Please sign in to comment.