Skip to content

/me or /user endpoint #596

Open
Open

Description

@jessfraz

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

Activity

  1. david-crespo commented on Jan 13, 2022

    @david-crespo
    Contributor

    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
    }

  2. jessfraz commented on Jan 13, 2022

    @jessfraz
    ContributorAuthor

    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

  3. davepacheco commented on Jan 13, 2022

    @davepacheco
    Collaborator

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

  4. added
    api
    mvp
    on Jan 23, 2022
  5. jessfraz commented on Mar 25, 2022

    @jessfraz
    ContributorAuthor

    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

  6. added this to the MVP milestone on Jan 20, 2023
  7. added
    obsolete
    on Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Remote Access Previewapimvpobsolete

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions