mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
be1c06dec9
- Adds a new API endpoint `GET /api/v2/users/oidc-claims` that returns only the **merged claims** (not the separate id_token/userinfo breakdown). Scoped exclusively to the authenticated user's own identity — no user parameter, so users cannot view each other's claims. - Adds a new CLI command:** `coder users oidc-claims` that hits the above endpoint. - The existing owner-only debug endpoint is preserved unchanged for admins who need the full claim breakdown. > 🤖 This PR was created with the help of Coder Agents, and will be reviewed by my human. 🧑💻
29 lines
634 B
Go
29 lines
634 B
Go
package cli
|
|
|
|
import (
|
|
"github.com/coder/coder/v2/codersdk"
|
|
"github.com/coder/serpent"
|
|
)
|
|
|
|
func (r *RootCmd) users() *serpent.Command {
|
|
cmd := &serpent.Command{
|
|
Short: "Manage users",
|
|
Use: "users [subcommand]",
|
|
Aliases: []string{"user"},
|
|
Handler: func(inv *serpent.Invocation) error {
|
|
return inv.Command.HelpHandler(inv)
|
|
},
|
|
Children: []*serpent.Command{
|
|
r.userCreate(),
|
|
r.userList(),
|
|
r.userSingle(),
|
|
r.userDelete(),
|
|
r.userEditRoles(),
|
|
r.userOIDCClaims(),
|
|
r.createUserStatusCommand(codersdk.UserStatusActive),
|
|
r.createUserStatusCommand(codersdk.UserStatusSuspended),
|
|
},
|
|
}
|
|
return cmd
|
|
}
|