-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add Default role assigning while creating and account or signin…
…g in [DEV-2905] (#286) * Add implementation for default role assigning for newcomers * Small refactoring of the authentication middleware * Change request body parsing * Small changes * Update package-lock.json * Annotate file * Add newline * Small refactoring and make review comments * Merge with develop and small improvements * Presentations are not guarded * Add newline character * Fix example * Remove credential-status/search from guarded paths * Fix resource create path * Update swagger.json * Added instructions in README * Add newline * Update package-lock.json --------- Co-authored-by: Ankur Banerjee <[email protected]>
- Loading branch information
Showing
21 changed files
with
378 additions
and
174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,4 +16,4 @@ export class AccountAuthHandler extends AbstractAuthHandler { | |
return this.commonPermissionCheck(request) | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { Request, Response } from "express"; | ||
import { AbstractAuthHandler } from "./base_auth.js"; | ||
import { IAuthResponse } from "../../types/authentication.js"; | ||
|
||
export class CredentialStatusAuthHandler extends AbstractAuthHandler { | ||
|
||
constructor () { | ||
super() | ||
this.registerRoute('/credential-status/create', 'POST', 'create:credential-status:testnet') | ||
this.registerRoute('/credential-status/create', 'POST', 'create:credential-status:mainnet') | ||
this.registerRoute('/credential-status/publish', 'POST', 'publish:credential-status:testnet') | ||
this.registerRoute('/credential-status/publish', 'POST', 'publish:credential-status:mainnet') | ||
this.registerRoute('/credential-status/update', 'POST', 'update:credential-status:testnet') | ||
this.registerRoute('/credential-status/update', 'POST', 'update:credential-status:mainnet') | ||
} | ||
public async handle(request: Request, response: Response): Promise<IAuthResponse> { | ||
if (!request.path.includes('/credential-status')) { | ||
return super.handle(request, response) | ||
} | ||
return this.commonPermissionCheck(request) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,4 +19,4 @@ export class KeyAuthHandler extends AbstractAuthHandler { | |
|
||
} | ||
|
||
} | ||
} |
Oops, something went wrong.