Skip to content

/me or /user endpoint #596

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
jessfraz opened this issue Jan 13, 2022 · 4 comments
Open

/me or /user endpoint #596

jessfraz opened this issue Jan 13, 2022 · 4 comments
Labels
Milestone

Comments

@jessfraz
Copy link
Contributor

something super basic that tells us info about the current authed user

you can pick your poison on the name, github uses /user but I've seen /me as well

I lean towards /user

@david-crespo
Copy link
Contributor

david-crespo commented Jan 13, 2022

Exists already, though we don't have a User model so it only returns the current user's UUID. It could be moved out of the console API file and renamed.

/// Fetch the user associated with the current session
#[endpoint {
method = GET,
path = "/session/me",
tags = ["hidden"],
}]
pub async fn session_me(
rqctx: Arc<RequestContext<Arc<ServerContext>>>,
) -> Result<HttpResponseOk<views::SessionUser>, HttpError> {
let apictx = rqctx.context();
let handler = async {
// TODO: we don't care about authentication method, as long as they are
// authed as _somebody_. We could restrict this to session auth only,
// but it's not clear what the advantage would be.
let opctx = OpContext::for_external_api(&rqctx).await?;
let &actor = opctx.authn.actor_required()?;
Ok(HttpResponseOk(actor.into()))
};
apictx.external_latencies.instrument_dropshot_handler(&rqctx, handler).await
}

@jessfraz
Copy link
Contributor Author

oh perfecrt somehow i missed that in the spec would be nice to have more info even if it is slightly stale from the idp

basically my use case is when the user wants to get their auth status from the cli I want to return this info like name, email, basic stuff so they know who they are logged in as

@davepacheco
Copy link
Collaborator

Yeah, we'll definitely put more information there once we implement IdP integration.

@jessfraz
Copy link
Contributor Author

also adding a note here just so we don't forget will also be nice to know the org the user is in, such that then for the cli I will set it as their default org, and check time to time to make sure it is still their org

@smklein smklein added this to the MVP milestone Jan 20, 2023
leftwo pushed a commit that referenced this issue Jan 28, 2024
Crucible changes
Remove a superfluous copy during write serialization (#1087)
Update to progenitor v0.5.0, pull in required Omicron updates (#1115)
Update usdt to v0.5.0 (#1116)
Do not panic on reinitialize of a downstairs client. (#1114)
Bump (tracing-)opentelemetry(-jaeger) (#1113)
Make the Guest -> Upstairs queue fully async (#1086)
Switch to per-block ownership (#1107)
Handle timeout in the client IO task (#1109)
Enforce buffer alignment (#1106)
Block size buffers (#1105)
New dtrace probes and a counter struct in the Upstairs. (#1104)
Implement read decryption offloading (#1089)
Remove Arc + Mutex from Buffer (#1094)
Comment cleanup and rename of DsState::Repair -> Reconcile (#1102)
do not panic the dynamometer for OOB writes (#1101)
Allow dsc to start the downstairs in read-only mode. (#1098)
Use the omicron-zone-package methods for topo sorting (#1099)
Package with topological sorting (#1097)
Fix clippy lints in dsc (#1095)

Propolis changes:
PHD: demote artifact store logs to DEBUG, enable DEBUG on CI (#626)
PHD: fix missing newlines in serial.log (#622)
PHD: fix run_shell_command with multiline commands (#621)
PHD: fix `--artifact-directory` not doing anything (#618)
Update h2 dependency
Update Crucible (and Omicron) dependencies
PHD: refactor guest serial console handling (#615)
phd: add basic "migration-from-base" tests + machinery (#609)
phd: Ensure min disk size fits read-only parents (#611)
phd: automatically fetch `crucible-downstairs` from Buildomat (#604)
Mitigate behavior from illumos#16183
PHD: add guest adapter for WS2022 (#607)
phd: include error cause chain in failure output (#606)
add QEMU pvpanic ISA device (#596)
Add crucible-mem backend
Make crucible opt parsing more terse in standalone
leftwo added a commit that referenced this issue Jan 29, 2024
Crucible changes
Remove a superfluous copy during write serialization (#1087) Update to
progenitor v0.5.0, pull in required Omicron updates (#1115) Update usdt
to v0.5.0 (#1116)
Do not panic on reinitialize of a downstairs client. (#1114) Bump
(tracing-)opentelemetry(-jaeger) (#1113)
Make the Guest -> Upstairs queue fully async (#1086) Switch to per-block
ownership (#1107)
Handle timeout in the client IO task (#1109)
Enforce buffer alignment (#1106)
Block size buffers (#1105)
New dtrace probes and a counter struct in the Upstairs. (#1104)
Implement read decryption offloading (#1089)
Remove Arc + Mutex from Buffer (#1094)
Comment cleanup and rename of DsState::Repair -> Reconcile (#1102) do
not panic the dynamometer for OOB writes (#1101) Allow dsc to start the
downstairs in read-only mode. (#1098) Use the omicron-zone-package
methods for topo sorting (#1099) Package with topological sorting
(#1097)
Fix clippy lints in dsc (#1095)

Propolis changes:
PHD: demote artifact store logs to DEBUG, enable DEBUG on CI (#626) 
PHD: fix missing newlines in serial.log (#622)
PHD: fix run_shell_command with multiline commands (#621) 
PHD: fix `--artifact-directory` not doing anything (#618) Update h2
dependency
Update Crucible (and Omicron) dependencies
PHD: refactor guest serial console handling (#615) 
phd: add basic "migration-from-base" tests + machinery (#609) 
phd: Ensure min disk size fits read-only parents (#611) 
phd: automatically fetch `crucible-downstairs` from Buildomat (#604)
Mitigate behavior from illumos#16183
PHD: add guest adapter for WS2022 (#607)
phd: include error cause chain in failure output (#606) add QEMU pvpanic
ISA device (#596)
Add crucible-mem backend
Make crucible opt parsing more terse in standalone

Co-authored-by: Alan Hanson <alan@oxide.computer>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants