-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SPSH-983 Send attributes to keycloak (#624)
* Send attributes to keycloak * Fix unrelated files * Fix some tests * Fix coverage * Make external system attributes optional * Remove attributes from keycloak response * Revert some changes
- Loading branch information
1 parent
3762006
commit c189c83
Showing
7 changed files
with
106 additions
and
25 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 |
---|---|---|
|
@@ -391,6 +391,9 @@ describe('DbSeedService', () => { | |
'testusername', | ||
'[email protected]', | ||
faker.date.recent(), | ||
{ | ||
ID_ITSLEARNING: faker.string.uuid(), | ||
}, | ||
); | ||
|
||
kcUserService.findOne.mockResolvedValueOnce({ ok: true, value: existingUser }); | ||
|
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,21 +1,31 @@ | ||
export type ExternalSystemIDs = { | ||
ID_ITSLEARNING?: string; | ||
}; | ||
|
||
export class User<WasPersisted extends boolean> { | ||
private constructor( | ||
public id: Persisted<string, WasPersisted>, | ||
public username: string, | ||
public email: string | undefined, | ||
public createdDate: Persisted<Date, WasPersisted>, | ||
public externalSystemIDs: ExternalSystemIDs, | ||
) {} | ||
|
||
public static createNew(username: string, email: string | undefined): User<false> { | ||
return new User(undefined, username, email, undefined); | ||
public static createNew( | ||
username: string, | ||
email: string | undefined, | ||
externalSystemIDs: ExternalSystemIDs, | ||
): User<false> { | ||
return new User(undefined, username, email, undefined, externalSystemIDs); | ||
} | ||
|
||
public static construct<WasPersisted extends boolean = true>( | ||
id: string, | ||
username: string, | ||
email: string | undefined, | ||
createdDate: Date, | ||
externalSystemIDs: ExternalSystemIDs, | ||
): User<WasPersisted> { | ||
return new User(id, username, email, createdDate); | ||
return new User(id, username, email, createdDate, externalSystemIDs); | ||
} | ||
} |
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