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

PB-1044 Add interface for cognito #29

Merged
merged 12 commits into from
Oct 24, 2024
Merged

Conversation

msom
Copy link
Contributor

@msom msom commented Oct 10, 2024

Added:

  • a low level service class cognito.utils.Service for managing cognito users
  • three functions in cognito.utils.user to be used in the API when creating, deleting and updating a user
  • a CLI command cognito_sync for synchronizing users (same base classes used as in PB-1026 Add BOD import command #23, taken from service-stac)
  • a new docker container cognito-local for local testing and development

@msom msom requested a review from schtibe October 10, 2024 11:06
@msom msom marked this pull request as draft October 10, 2024 11:06
@msom msom force-pushed the feat-pb-1044-populate-cognito branch from 1b36237 to 474a0e1 Compare October 10, 2024 12:04
Copy link
Contributor

@schtibe schtibe 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!! 🚀
I have a few remarks in the code.

Some thought I just had:
Would it be good to have an attribute in the pool that is set when the user is managed from service control? So that when we clear and remove users, we only take the ones that have this attribute/flag.
Like this it would be possible to have manually created users that won't be removed by the sync command. This could prove to be handy for debugging purposes, or when we need an admin user of some sort.

(FYI. the build currently fails because of the TODOs in the code)

app/utils/command.py Show resolved Hide resolved
app/cognito/utils/user.py Outdated Show resolved Hide resolved
app/cognito/utils/user.py Outdated Show resolved Hide resolved
app/cognito/utils/client.py Outdated Show resolved Hide resolved
Copy link

@boecklic boecklic left a comment

Choose a reason for hiding this comment

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

nice!

README.md Outdated Show resolved Hide resolved
app/cognito/management/commands/cognito_sync.py Outdated Show resolved Hide resolved
app/cognito/utils/client.py Outdated Show resolved Hide resolved
app/utils/command.py Show resolved Hide resolved
@msom
Copy link
Contributor Author

msom commented Oct 15, 2024

Added, as discussed, a managed flag.

@msom msom force-pushed the feat-pb-1044-populate-cognito branch from 47df145 to 91fce2e Compare October 22, 2024 07:32
@msom msom marked this pull request as ready for review October 22, 2024 09:51
Copy link
Contributor

@asteiner-swisstopo asteiner-swisstopo left a comment

Choose a reason for hiding this comment

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

Looks good to me 👍

@msom msom force-pushed the feat-pb-1044-populate-cognito branch from 56abee6 to 1c68348 Compare October 24, 2024 08:53
@msom msom merged commit f6d5866 into develop Oct 24, 2024
3 checks passed
@msom msom deleted the feat-pb-1044-populate-cognito branch October 24, 2024 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants