Skip to content
This repository has been archived by the owner on Oct 3, 2024. It is now read-only.

Allow user with multiple roles, add UserManager role #86

Merged
merged 2 commits into from
Aug 20, 2024

Conversation

rnijveld
Copy link
Member

@rnijveld rnijveld commented Aug 20, 2024

This implements the first part of #82 I added the ability to add multiple roles specifically to allow creating a kind of superuser account for testing purposes.

Copy link

codecov bot commented Aug 20, 2024

Codecov Report

Attention: Patch coverage is 29.72973% with 52 lines in your changes missing coverage. Please review.

Project coverage is 61.50%. Comparing base (0334351) to head (b1d9618).
Report is 3 commits behind head on main.

Files Patch % Lines
openadr-vtn/src/jwt.rs 19.67% 49 Missing ⚠️
openadr-vtn/src/api/auth.rs 0.00% 1 Missing ⚠️
openadr-vtn/src/api/report.rs 0.00% 1 Missing ⚠️
openadr-vtn/src/main.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #86      +/-   ##
==========================================
- Coverage   62.39%   61.50%   -0.89%     
==========================================
  Files          28       28              
  Lines        3438     3484      +46     
==========================================
- Hits         2145     2143       -2     
- Misses       1293     1341      +48     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

.collect()
}

pub fn business_ids(&self) -> (Vec<String>, bool) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would this be better as an enum Foo {Any, Specific(Vec<String>)}?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good idea! Will change!

}

impl Claims {
pub fn ven_ids(&self) -> Vec<String> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could this be a new-type instead of String?

Copy link
Member Author

@rnijveld rnijveld Aug 20, 2024

Choose a reason for hiding this comment

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

Probably will be a newtype eventually, given we already have several of those, but I wanted to keep this PR a little smaller.

@tdittr tdittr merged commit 3ce2670 into main Aug 20, 2024
11 checks passed
@tdittr tdittr deleted the allow-multiple-users branch August 20, 2024 12:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants