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

feat: adds endpoints to manually create users and groups from the provider #863

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

simonseyock
Copy link
Member

This adds endpoints to manually create users and groups from the provider. This is useful in case the users and groups are not created while shogun is running.

Removed the LoginListener because it is not used anymore.

Description

Related issues or pull requests

Pull request type

  • Bugfix
  • Feature
  • Dependency updates
  • Tests
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe)

Do you introduce a breaking change?

  • Yes
  • No

Checklist

  • I understand and agree that the changes in this PR will be licensed under the
    Apache Licence Version 2.0.
  • I have followed the guidelines for contributing.
  • The proposed change fits to the content of the code of conduct.
  • I have added or updated tests and documentation, and the test suite passes (run mvn test locally).
  • I have added a screenshot/screencast to illustrate the visual output of my update.

@simonseyock
Copy link
Member Author

This is missing the appropriate security checks at the moment.

Copy link
Member

@dnlkoch dnlkoch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice so far @simonseyock!

Comment on lines +101 to +105
@PostMapping("/createFromProvider")
@ResponseStatus(HttpStatus.OK)
public void createFromProvider() {
groupProviderService.createAllGroups();
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add some notes for the OpenAPI spec? The controllers in the BaseController might be a good inspiration.

And can we also add some error handling?

Comment on lines +47 to +51
@PostMapping("/createFromProvider")
@ResponseStatus(HttpStatus.OK)
public void createFromProvider() {
userProviderService.createAllUsers();
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above.

@@ -33,4 +33,5 @@ public interface GroupProviderService<UserType, GroupType> {

Group<GroupType> findOrCreateByProviderId(String providerGroupId);

void createAllGroups();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wondering, do we need to flag this commit as breaking?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not breaking anything, is it? It's a new feature.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it's changing an interface, project implementations would need to include the implementation of the newly added method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants