-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
680 additions
and
136 deletions.
There are no files selected for viewing
Empty file.
1 change: 1 addition & 0 deletions
1
...t-adapter/dist/__tests__/acceptance/authentication-with-passport-strategy.acceptance.d.ts
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 @@ | ||
export {}; |
272 changes: 272 additions & 0 deletions
272
...ort-adapter/dist/__tests__/acceptance/authentication-with-passport-strategy.acceptance.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
...adapter/dist/__tests__/acceptance/authentication-with-passport-strategy.acceptance.js.map
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
experimental/passport-adapter/dist/__tests__/unit/fixtures/mock-passport-strategy.d.ts
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,28 @@ | ||
import {Request} from '@loopback/rest'; | ||
import {AuthenticateOptions, Strategy} from 'passport'; | ||
import {UserProfile} from '@loopback/authentication'; | ||
/** | ||
* Test fixture for a mock asynchronous passport-strategy | ||
*/ | ||
export declare class MockPassportStrategy extends Strategy { | ||
private mockUser; | ||
setMockUser(userObj: UserProfile): void; | ||
/** | ||
* authenticate() function similar to passport-strategy packages | ||
* @param req | ||
*/ | ||
authenticate(req: Request, options?: AuthenticateOptions): Promise<void>; | ||
/** | ||
* @param req | ||
* mock verification function; usually passed in as constructor argument for | ||
* passport-strategy | ||
* | ||
* For the purpose of mock tests we have this here | ||
* pass req.query.testState = 'fail' to mock failed authorization | ||
* pass req.query.testState = 'error' to mock unexpected error | ||
*/ | ||
verify(request: Request): Promise<void>; | ||
returnMockUser(): void; | ||
returnUnauthorized(challenge?: string | number, status?: number): void; | ||
returnError(err: string): void; | ||
} |
60 changes: 60 additions & 0 deletions
60
experimental/passport-adapter/dist/__tests__/unit/fixtures/mock-passport-strategy.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
experimental/passport-adapter/dist/__tests__/unit/fixtures/mock-passport-strategy.js.map
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
experimental/passport-adapter/dist/__tests__/unit/strategy-adapter.unit.d.ts
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 @@ | ||
export {}; |
Oops, something went wrong.