Skip to content
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

Microservice without user management shall not generate User and Authority entities as well as related resources #18921

Closed
wants to merge 9 commits into from

Conversation

ko5tik
Copy link
Contributor

@ko5tik ko5tik commented Jun 15, 2022

This PR fixes #18755 - (not)generation of user administration artifacts. Currently when 0Auth2 is actoivated user entotoes and
supporting classes are generated for all backend microservices even if they have this feature explicitely switched off
in .yo-rc.json

Proposed behaviour is to honor explicit settings ( which is generated into .yo-rc.jason by default anyway )


Please make sure the below checklist is followed for Pull Requests.

- do not force activate user management for oauth2
- use explicit setting for creation of user management  entitites.
@ko5tik
Copy link
Contributor Author

ko5tik commented Jun 16, 2022

I see that there is a bug, update will follow soon

@ko5tik
Copy link
Contributor Author

ko5tik commented Jun 17, 2022

@DanielFran, @mshima since it seems to be your use case - there is pipeline error, in [ms-ngx-eureka-oauth2-mongodb-caffeine - because oauth2 does not activate user entity generation atuomatically. Not sure how to fix it

  • explict setting in the pipeline for "skipUserManagement false" , or implicit activation in case there is relation to user entity.

@CLAassistant
Copy link

CLAassistant commented Jun 17, 2022

CLA assistant check
All committers have signed the CLA.

@DanielFran DanielFran changed the title 18755 no user if not necessary Microservice without user management shall not generate User and Authority entities as well as related resources Jun 27, 2022
@DanielFran
Copy link
Member

@ko5tik @mshima I believe that this has already been fixed on main branch. Can you confirm?

@mshima
Copy link
Member

mshima commented Apr 21, 2023

@DanielFran no, but we should this PR can be closed. There is a full application in it.
Since no database is fixed without the User entities, it should be easier to implement now.

// TODO make UserEntity optional on relationships for microservices and oauth2
// TODO check if we support syncWithIdp using jwt authentication
// Used for relationships and syncWithIdp
const usesSyncWithIdp = dest.authenticationType === OAUTH2 && dest.databaseType !== NO_DATABASE;
dest.generateBuiltInUserEntity = dest.generateUserManagement || usesSyncWithIdp;

I will post the comment at the issue for reference.
Closing the PR for now, once cleaned please reopen.

@mshima mshima closed this Apr 21, 2023
@DanielFran DanielFran added this to the 8.0.0-beta.1 milestone Jun 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants