-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(user-tenant-service):add idp controller to manage users in user tenant service #39
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we over populating same service class to communicate with different services
move to a separate service class file
@@ -133,3 +134,16 @@ export interface IValue { | |||
name: string; | |||
value: number | string | boolean; | |||
} | |||
export type ConfigureIdpFunc<T> = (payload: IdpDetails) => Promise<T>; | |||
|
|||
export interface IdpDetails { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why anyObject
and also a model is defined named IdpDetails so why an interface also
cant we use any one
import {UserCredentialsRepository} from '@sourceloop/user-tenant-service'; | ||
import {repository} from '@loopback/repository'; | ||
|
||
const basePath = '/idp/users'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not making sense
}; | ||
switch (payload.tenant.identityProvider) { | ||
case IdPKey.COGNITO: | ||
break; | ||
case IdPKey.KEYCLOAK: | ||
res = await this.idpKeycloakProvider(payload); | ||
await this.userCredentialsRepository.create({ | ||
authProvider: 'keycloak', | ||
password:res.authSecret, | ||
userId: res.authId, | ||
}); | ||
break; | ||
default: | ||
break; | ||
} | ||
return res; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not returning directly from the switch case ??
const token = await this.authenticateAdmin(); | ||
|
||
// Fetch the clientId, clientSecret, and realmName from AWS SSM | ||
const clientId = process.env.KEYCLOAK_CLIENT_ID as string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add the new env variables to env.example file
cdbc244
to
be1f633
Compare
resolve comments GH-38
be1f633
to
71c50fa
Compare
Description
add idp controller to manage users in user tenant service
Fixes #38
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Checklist: