-
Notifications
You must be signed in to change notification settings - Fork 59
[SCIM 3/4]: SCIM client token CRUD + Bearer auth #9180
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
Open
jmpesp
wants to merge
11
commits into
oxidecomputer:main
Choose a base branch
from
jmpesp:scim_token_crud_and_auth
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 7 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
dea9bf9
[SCIM 3/4]: SCIM client token CRUD + Bearer auth
jmpesp 56d5288
remove the "delete all tokens" endpoint
jmpesp 6e67ae9
remove delete all from VERIFY_ENDPOINTS
jmpesp 9bbb011
patterm
jmpesp ed37a89
Use authz lookup on bearer token itself
jmpesp 88c03f6
Merge branch 'main' into scim_token_crud_and_auth
jmpesp 2b03a76
Merge branch 'main' into scim_token_crud_and_auth
jmpesp 880fb63
rename to scim_get_provider_from_bearer_token
jmpesp 76b452e
remove list-children grant for external-scim, not necessary
jmpesp 5cebf49
just fetch
jmpesp 3b3b891
add new Actor::Scim variant
jmpesp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// This Source Code Form is subject to the terms of the Mozilla Public | ||
// License, v. 2.0. If a copy of the MPL was not distributed with this | ||
// file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
|
||
use chrono::DateTime; | ||
use chrono::Utc; | ||
use nexus_db_schema::schema::scim_client_bearer_token; | ||
use nexus_types::external_api::views; | ||
use uuid::Uuid; | ||
|
||
/// A SCIM client sends requests to a SCIM provider (in this case, Nexus) using | ||
/// some sort of authentication. Nexus currently only supports Bearer token auth | ||
/// from SCIM clients, and these tokens are stored here. | ||
#[derive(Queryable, Insertable, Clone, Debug, Selectable)] | ||
#[diesel(table_name = scim_client_bearer_token)] | ||
pub struct ScimClientBearerToken { | ||
pub id: Uuid, | ||
|
||
pub time_created: DateTime<Utc>, | ||
pub time_deleted: Option<DateTime<Utc>>, | ||
pub time_expires: Option<DateTime<Utc>>, | ||
|
||
pub silo_id: Uuid, | ||
|
||
pub bearer_token: String, | ||
} | ||
|
||
impl ScimClientBearerToken { | ||
pub fn id(&self) -> Uuid { | ||
self.id | ||
} | ||
} | ||
|
||
impl From<ScimClientBearerToken> for views::ScimClientBearerToken { | ||
fn from(t: ScimClientBearerToken) -> views::ScimClientBearerToken { | ||
views::ScimClientBearerToken { | ||
id: t.id, | ||
time_created: t.time_created, | ||
time_expires: t.time_expires, | ||
} | ||
} | ||
} | ||
|
||
impl From<ScimClientBearerToken> for views::ScimClientBearerTokenValue { | ||
fn from(t: ScimClientBearerToken) -> views::ScimClientBearerTokenValue { | ||
views::ScimClientBearerTokenValue { | ||
id: t.id, | ||
time_created: t.time_created, | ||
time_expires: t.time_expires, | ||
bearer_token: t.bearer_token, | ||
} | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this needed?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I can't find a spot where the
external-scim
opctx needs to do this. Is it intended for the unimplemented list users operation etc?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, removed in 76b452e