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: add identity manager #1505

Merged
merged 3 commits into from
Jan 7, 2025
Merged

feat: add identity manager #1505

merged 3 commits into from
Jan 7, 2025

Conversation

kian99
Copy link
Contributor

@kian99 kian99 commented Dec 20, 2024

Description

This PR introduces an identity manager. Note that the identity manager doesn't create identity (that is only done on login), rather the identity manager performs operations like Fetch, Count and List identities.

Fixes JUJU-7254

Engineering checklist

  • Documentation updated
  • Covered by unit tests
  • Covered by integration tests

@kian99 kian99 requested a review from a team as a code owner December 20, 2024 06:54
@kian99 kian99 mentioned this pull request Dec 20, 2024
3 tasks
internal/jimm/identity/export_test.go Show resolved Hide resolved
internal/jimm/identity/identity.go Outdated Show resolved Hide resolved
)

// identityManager provides a means to manage identities within JIMM.
type identityManager struct {
Copy link
Collaborator

Choose a reason for hiding this comment

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

i would suggest exporting the identityManager type

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As discussed, I think we should definitely do this but in a separate piece of work.

Copy link
Collaborator

Choose a reason for hiding this comment

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

please create a jira ticket to at least discuss the issue if not to address it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

var users []openfga.User

for _, id := range identities {
users = append(users, *openfga.NewUser(&id, j.authSvc))
Copy link
Collaborator

Choose a reason for hiding this comment

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

openfga.NewUser looks like another opportunity for a factory.. something like

  userFactory := openfga.NewUserFactor(j.authSvc)

and then we could do something like

  user := userFactory.New(id)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Very true, good for a separate piece of work.

internal/jimm/jimm.go Show resolved Hide resolved
internal/jimm/jimm.go Show resolved Hide resolved
Copy link
Contributor

@SimoneDutto SimoneDutto left a comment

Choose a reason for hiding this comment

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

lgtm

@kian99 kian99 requested a review from alesstimec January 7, 2025 08:08
)

// identityManager provides a means to manage identities within JIMM.
type identityManager struct {
Copy link
Collaborator

Choose a reason for hiding this comment

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

please create a jira ticket to at least discuss the issue if not to address it

@kian99 kian99 merged commit a314019 into canonical:v3 Jan 7, 2025
4 checks passed
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.

3 participants