diff --git a/.changeset/token-ui-restrictions.md b/.changeset/token-ui-restrictions.md new file mode 100644 index 00000000..0827671f --- /dev/null +++ b/.changeset/token-ui-restrictions.md @@ -0,0 +1,21 @@ +--- +"@shelve/app": minor +--- + +Two related UI improvements around the v5 security surface. + +**Tokens** + +- Token creation now exposes the full scope surface that the backend already supports: restrict a token to specific **teams**, **projects**, and **environments** via cascading multi-select pickers, and add an **IP allowlist** (CIDR ranges) with inline validation. +- A clear "unscoped token" warning when no restriction is applied. +- The tokens table shows what each token is actually scoped to (teams / projects / envs / CIDRs counts) instead of a generic "scoped" badge. +- The popover form was replaced with a roomier modal so the new options have space to breathe. `Token.allowedCidrs` is now part of the public `Token` type. + +**Audit logs** + +- Color-coded action badges (create=success, delete=error, update / token.* = warning, auth.* = info) and resource icons (variable / environment / project / token / …). +- Actor badges include a matching icon (`user`, `key-round`, `cpu`). +- IP rendered as a monospace pill. +- The very long raw `User-Agent` string is parsed to a friendly client label (e.g. `Shelve CLI 5.0.0`, `Chrome 147 · macOS`, `Node.js`, `curl 8.6.0`) with the full UA available on hover. +- New per-row metadata popover (`{}` icon) showing the full JSON payload for that event, instead of having no way to inspect it. +- Empty state and centered "Load more" button. diff --git a/apps/shelve/app/components/token/Create.vue b/apps/shelve/app/components/token/Create.vue index 6fbeaacd..6839dccb 100644 --- a/apps/shelve/app/components/token/Create.vue +++ b/apps/shelve/app/components/token/Create.vue @@ -1,14 +1,35 @@ diff --git a/apps/shelve/app/components/token/Scopes.vue b/apps/shelve/app/components/token/Scopes.vue new file mode 100644 index 00000000..a7107712 --- /dev/null +++ b/apps/shelve/app/components/token/Scopes.vue @@ -0,0 +1,58 @@ + + + diff --git a/apps/shelve/app/pages/[teamSlug]/team/audit-logs.vue b/apps/shelve/app/pages/[teamSlug]/team/audit-logs.vue index 44b5d2f2..a81d2870 100644 --- a/apps/shelve/app/pages/[teamSlug]/team/audit-logs.vue +++ b/apps/shelve/app/pages/[teamSlug]/team/audit-logs.vue @@ -1,6 +1,7 @@