-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
process kyb applications, creating CDD is address is specified in the…
… original request
- Loading branch information
1 parent
d25ee97
commit 0dc3462
Showing
18 changed files
with
429 additions
and
63 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# Environment | ||
.env | ||
.nx | ||
|
||
# compiled output | ||
dist | ||
|
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 |
---|---|---|
@@ -1,9 +1,13 @@ | ||
export const netkiAvailableCodesPrefix = 'netki-codes' as const; | ||
export const netkiAllocatedCodePrefix = 'netki-allocated-codes:' as const; | ||
export const netkiBusinessAppPrefix = 'netki-business-codes:' as const; | ||
export const netkiBusinessToAddressPrefix = 'netki-business-address:' as const; | ||
|
||
export const netkiAddressPrefixer = (id: string) => | ||
`${netkiAllocatedCodePrefix}${id}`; | ||
|
||
export const netkiBusinessAppPrefixer = (id: string) => | ||
`${netkiBusinessAppPrefix}${id}`; | ||
|
||
export const netkiBusinessToAddressPrefixer = (address: string) => | ||
`${netkiBusinessToAddressPrefix}${address}`; |
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
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { mockHttpContext } from '../test-utils/mocks'; | ||
import { ApiKeyGuard } from './api-key.guard'; | ||
|
||
describe('ApiKeyGuard', () => { | ||
let apiKeyGuard: ApiKeyGuard; | ||
const allowedApiKeys = ['someApiKey']; | ||
|
||
beforeEach(() => { | ||
apiKeyGuard = new ApiKeyGuard(allowedApiKeys); | ||
}); | ||
|
||
describe('canActivate', () => { | ||
it('should return true if the client Authorization header is included in the allowed basic auth', () => { | ||
const httpContext = mockHttpContext('::1', 'Bearer someApiKey', {}); | ||
const canActivate = apiKeyGuard.canActivate(httpContext); | ||
expect(canActivate).toBe(true); | ||
}); | ||
|
||
it('should return false if the client Authorization header is not included in the basic auth', () => { | ||
const httpContext = mockHttpContext('::1', 'Bearer BAD-KEY', {}); | ||
|
||
const canActivate = apiKeyGuard.canActivate(httpContext); | ||
expect(canActivate).toBe(false); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.