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

Added KeyIdentity to replace KeyTriple #500

Conversation

MattDavis00
Copy link
Member

KeyIdentity contains an ApplicationIdentity, ProviderIdentity and a key_name.
KeyTriple still exists but solely for the use by the OnDiskKeyInfoManager.
This is preliminary work towards the new SQLiteKeyInfoManager as part of #486

Apologies for the large pr... 👨🏼‍💻

There may be some incorrect variable naming in places regarding key_triple where it should be key_identity instead. I will address this in a future PR as this will be a ~200 loc by itself.

Closes #488

Signed-off-by: Matt Davis [email protected]

@ionut-arm ionut-arm self-requested a review August 9, 2021 12:23
Copy link
Member

@ionut-arm ionut-arm left a comment

Choose a reason for hiding this comment

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

Thanks for the massive change! 💪🏻 I left a bunch of comments below, apologies if some of them seem to contradict each other - I went on a journey of self-discovery myself, reading through this.

src/key_info_managers/mod.rs Outdated Show resolved Hide resolved
src/key_info_managers/mod.rs Outdated Show resolved Hide resolved
src/key_info_managers/mod.rs Outdated Show resolved Hide resolved
src/key_info_managers/on_disk_manager/mod.rs Outdated Show resolved Hide resolved
src/key_info_managers/mod.rs Outdated Show resolved Hide resolved
src/authenticators/mod.rs Outdated Show resolved Hide resolved
src/key_info_managers/on_disk_manager/mod.rs Outdated Show resolved Hide resolved
src/key_info_managers/mod.rs Show resolved Hide resolved
src/providers/core/mod.rs Outdated Show resolved Hide resolved
src/key_info_managers/mod.rs Outdated Show resolved Hide resolved
Copy link
Member

@ionut-arm ionut-arm left a comment

Choose a reason for hiding this comment

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

Another few comments, should've noticed the pub fields yesterday :(

src/authenticators/mod.rs Show resolved Hide resolved
src/authenticators/mod.rs Outdated Show resolved Hide resolved
Copy link
Member

@hug-dev hug-dev left a comment

Choose a reason for hiding this comment

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

Thanks for the changes. Sorry for the big amount of review comments adding up to what you already got 😛
It is good though since this is a big and important change!

src/authenticators/mod.rs Outdated Show resolved Hide resolved
src/authenticators/mod.rs Outdated Show resolved Hide resolved
src/authenticators/mod.rs Show resolved Hide resolved
src/key_info_managers/mod.rs Outdated Show resolved Hide resolved
src/providers/mod.rs Show resolved Hide resolved
src/providers/mod.rs Outdated Show resolved Hide resolved
@MattDavis00 MattDavis00 force-pushed the feature-key-identity branch 2 times, most recently from 21b263e to 3620599 Compare August 20, 2021 10:31
@MattDavis00
Copy link
Member Author

MattDavis00 commented Aug 20, 2021

Currently admin operations such as delete_client are not scoped to the authenticator of the administrator.
Example:

  • Apps:
    app1-authenticator A
    app2-authenticator B
  • Admin:
    admin-authenticator B

Currently the admin can delete both app1 and app2. With regards to the new KIM and admin permissions, how do we want this to work? Currently only 1 authenticator is supported and hence this isn't really an issue yet. Do we want an administrator authenticated with authenticator B to be scoped only to actions on authenticator B resources, or do we want them to have "global" admin privileges where they can perform admin actions on any resource regardless of authenticator?

Edit: I have implemented the scoped version of this, rather than the "global" version of this. This is as we can always revert to a more lenient/less-restrictive set of permissions if we wish to.

KeyIdentity contains a ApplicationIdentity, ProviderIdentity and a key_name.
KeyTriple still exists but solely for the use by the on_disk_manager KIM.
This is preliminary work towards the new SQLite KIM as part of parallaxsecond#486

Closes parallaxsecond#488

Signed-off-by: Matt Davis <[email protected]>
Copy link
Member

@hug-dev hug-dev left a comment

Choose a reason for hiding this comment

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

Mainly fine for me. I think I should not block the implementation for too long since this is hard to work little by little here. And it's all OK since you are on your own branch.

Do we want an administrator authenticated with authenticator B to be scoped only to actions on authenticator B resources, or do we want them to have "global" admin privileges where they can perform admin actions on any resource regardless of authenticator?

I think the scoped version is the one that we want. Having the new KIM in mind we wrote in the book:

Only the clients using the same authentication method as this request will be deleted. It has no impact currently as only one authentication method in the service is supported but might do if the service supports multiple.

src/key_info_managers/mod.rs Show resolved Hide resolved
src/key_info_managers/mod.rs Show resolved Hide resolved
src/key_info_managers/mod.rs Show resolved Hide resolved
src/key_info_managers/mod.rs Show resolved Hide resolved
src/key_info_managers/mod.rs Show resolved Hide resolved
@MattDavis00 MattDavis00 merged commit d353e92 into parallaxsecond:feature-sqlite-kim Aug 25, 2021
@MattDavis00 MattDavis00 deleted the feature-key-identity branch September 2, 2021 14:34
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