@webx-ui/module-auth 0.10.2 → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AdminsPage.d.ts +16 -2
- package/dist/KeyDialog.d.ts +2 -0
- package/dist/KeyList.d.ts +7 -0
- package/dist/clipboard.d.ts +8 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +1682 -1073
- package/dist/index.js.map +1 -1
- package/dist/keys.d.ts +12 -0
- package/dist/module.d.ts +2 -2
- package/dist/style.css +1 -1
- package/dist/types.d.ts +47 -0
- package/package.json +2 -2
package/dist/keys.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AdminContext } from '@webx-ui/module-admin';
|
|
2
|
+
import { IssuedMcpKey, McpKey, McpKeyInput, McpKeys } from './types';
|
|
3
|
+
export interface KeysApi {
|
|
4
|
+
/** Every key, live ones first. Behind `admins.manage`. */
|
|
5
|
+
list(): Promise<McpKeys>;
|
|
6
|
+
/** Issue one. The answer carries the secret, once. */
|
|
7
|
+
issue(input: McpKeyInput): Promise<IssuedMcpKey>;
|
|
8
|
+
/** Switch one off. The row stays; the key stops working at once. */
|
|
9
|
+
revoke(id: number): Promise<McpKey>;
|
|
10
|
+
}
|
|
11
|
+
/** The three calls behind Administrators → Keys. */
|
|
12
|
+
export declare function createKeysApi(admin: AdminContext): KeysApi;
|
package/dist/module.d.ts
CHANGED
|
@@ -13,8 +13,8 @@ export interface AdminsOptions {
|
|
|
13
13
|
/** Turns an avatar key into an address. Omitted, rows and forms show initials. */
|
|
14
14
|
resolveAvatar?: (key: string) => Promise<string | null>;
|
|
15
15
|
}
|
|
16
|
-
/** Which of the
|
|
17
|
-
export type AdminsView = 'admins' | 'calls' | 'connections';
|
|
16
|
+
/** Which of the four views of the administrators section a route opens. */
|
|
17
|
+
export type AdminsView = 'admins' | 'calls' | 'connections' | 'keys';
|
|
18
18
|
/**
|
|
19
19
|
* The administrators, as a section of the panel.
|
|
20
20
|
*
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.wx-login[data-v-3c206e31]{width:100%;max-width:26rem}.wx-login__message[data-v-3c206e31]{margin-block-end:var(--wx-space-4)}.wx-login__remember[data-v-3c206e31]{margin-block-start:calc(-1 * var(--wx-space-12))}.wx-login__reveal[data-v-3c206e31]{display:inline-flex;align-items:center;padding:0;font:inherit;color:var(--wx-text-muted);background:none;border:0;cursor:pointer}.wx-login__reveal[data-v-3c206e31]:hover,.wx-login__reveal[aria-pressed=true][data-v-3c206e31]{color:var(--wx-text-default)}.wx-admin-form{container-type:inline-size}.wx-admin-form__grid{display:grid;grid-template-columns:minmax(0,1fr);gap:var(--wx-space-24)}.wx-admin-form__grid.has-aside{grid-template-columns:200px minmax(0,1fr)}.wx-admin-form__fields{display:flex;flex-direction:column;gap:var(--wx-space-12);min-width:0}@container (max-width: 520px){.wx-admin-form__grid.has-aside{grid-template-columns:minmax(0,1fr)}.wx-admin-form__aside{max-width:200px}}.wx-admin-list,.wx-call-list{min-width:0}.wx-call-list__details{display:flex;flex-direction:column;gap:var(--wx-space-8);padding:var(--wx-space-8) var(--wx-space-16)}.wx-call-list__card-details{margin-top:var(--wx-space-8)}.wx-call-list__glyph{display:flex;align-items:center;justify-content:center;width:100%;height:100%;color:var(--wx-text-muted);background:var(--wx-bg-subtle)}.wx-call-list__label{display:flex;flex-wrap:wrap;align-items:baseline;gap:var(--wx-space-4) var(--wx-space-8)}.wx-call-list__arguments{margin:0;padding:var(--wx-space-8) var(--wx-space-12);max-height:320px;overflow:auto;border:1px solid var(--wx-border-muted);border-radius:var(--wx-radius-sm);background:var(--wx-bg-surface);color:var(--wx-text-default);font-family:var(--wx-font-family-mono);font-size:var(--wx-font-size-xs);line-height:var(--wx-font-line-height-relaxed);white-space:pre-wrap;word-break:break-word}.wx-connection-list{min-width:0}.wx-connection-list__glyph{display:flex;align-items:center;justify-content:center;width:100%;height:100%;color:var(--wx-text-muted);background:var(--wx-bg-subtle)}.wx-connection-list .wx-table__row.is-ended,.wx-connection-list .wx-table__card.is-ended{opacity:.6}.wx-content-rules[data-v-55be157e]{display:flex;flex-direction:column;gap:var(--wx-space-12);min-width:0}.wx-content-rules__foot[data-v-55be157e]{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:var(--wx-space-12)}.wx-connect[data-v-
|
|
1
|
+
.wx-login[data-v-3c206e31]{width:100%;max-width:26rem}.wx-login__message[data-v-3c206e31]{margin-block-end:var(--wx-space-4)}.wx-login__remember[data-v-3c206e31]{margin-block-start:calc(-1 * var(--wx-space-12))}.wx-login__reveal[data-v-3c206e31]{display:inline-flex;align-items:center;padding:0;font:inherit;color:var(--wx-text-muted);background:none;border:0;cursor:pointer}.wx-login__reveal[data-v-3c206e31]:hover,.wx-login__reveal[aria-pressed=true][data-v-3c206e31]{color:var(--wx-text-default)}.wx-admin-form{container-type:inline-size}.wx-admin-form__grid{display:grid;grid-template-columns:minmax(0,1fr);gap:var(--wx-space-24)}.wx-admin-form__grid.has-aside{grid-template-columns:200px minmax(0,1fr)}.wx-admin-form__fields{display:flex;flex-direction:column;gap:var(--wx-space-12);min-width:0}@container (max-width: 520px){.wx-admin-form__grid.has-aside{grid-template-columns:minmax(0,1fr)}.wx-admin-form__aside{max-width:200px}}.wx-admin-list,.wx-call-list{min-width:0}.wx-call-list__details{display:flex;flex-direction:column;gap:var(--wx-space-8);padding:var(--wx-space-8) var(--wx-space-16)}.wx-call-list__card-details{margin-top:var(--wx-space-8)}.wx-call-list__glyph{display:flex;align-items:center;justify-content:center;width:100%;height:100%;color:var(--wx-text-muted);background:var(--wx-bg-subtle)}.wx-call-list__label{display:flex;flex-wrap:wrap;align-items:baseline;gap:var(--wx-space-4) var(--wx-space-8)}.wx-call-list__arguments{margin:0;padding:var(--wx-space-8) var(--wx-space-12);max-height:320px;overflow:auto;border:1px solid var(--wx-border-muted);border-radius:var(--wx-radius-sm);background:var(--wx-bg-surface);color:var(--wx-text-default);font-family:var(--wx-font-family-mono);font-size:var(--wx-font-size-xs);line-height:var(--wx-font-line-height-relaxed);white-space:pre-wrap;word-break:break-word}.wx-connection-list{min-width:0}.wx-connection-list__glyph{display:flex;align-items:center;justify-content:center;width:100%;height:100%;color:var(--wx-text-muted);background:var(--wx-bg-subtle)}.wx-connection-list .wx-table__row.is-ended,.wx-connection-list .wx-table__card.is-ended{opacity:.6}.wx-key-dialog{display:flex;flex-direction:column;gap:var(--wx-space-12);min-width:0;container-type:inline-size}.wx-key-dialog__secret{display:flex;gap:var(--wx-space-8);min-width:0}.wx-key-dialog__secret>:first-child{flex:1 1 auto;min-width:0}@container (max-width: 420px){.wx-key-dialog__secret{flex-direction:column}}.wx-key-list{min-width:0}.wx-key-list__glyph{display:flex;align-items:center;justify-content:center;width:100%;height:100%;color:var(--wx-text-muted);background:var(--wx-bg-subtle)}.wx-key-list .wx-table__row.is-ended,.wx-key-list .wx-table__card.is-ended{opacity:.6}.wx-content-rules[data-v-55be157e]{display:flex;flex-direction:column;gap:var(--wx-space-12);min-width:0}.wx-content-rules__foot[data-v-55be157e]{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:var(--wx-space-12)}.wx-connect[data-v-19a489e0]{display:flex;flex-direction:column;gap:var(--wx-space-24);min-width:0}.wx-connect__lead[data-v-19a489e0]{max-width:68ch}.wx-connect__row[data-v-19a489e0]{display:flex;flex-wrap:wrap;align-items:center;gap:var(--wx-space-12)}.wx-connect__url[data-v-19a489e0]{flex:1 1 260px;min-width:0;padding:var(--wx-space-10) var(--wx-space-12);border-radius:var(--wx-radius-sm);background:var(--wx-bg-subtle);color:var(--wx-text-default);font-family:var(--wx-font-family-mono);font-size:var(--wx-font-size-md);word-break:break-all}.wx-connect__section[data-v-19a489e0]{display:flex;flex-direction:column;gap:var(--wx-space-12);min-width:0}.wx-connect__steps[data-v-19a489e0]{display:flex;flex-direction:column;gap:var(--wx-space-8);margin:0;padding-left:var(--wx-space-24);color:var(--wx-text-default);font-size:var(--wx-font-size-sm);line-height:var(--wx-font-line-height-relaxed)}.wx-connect__snippet[data-v-19a489e0]{display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;gap:var(--wx-space-8);padding:var(--wx-space-12);border-radius:var(--wx-radius-sm);background:var(--wx-bg-subtle)}.wx-connect__snippet pre[data-v-19a489e0]{flex:1 1 240px;margin:0;min-width:0;color:var(--wx-text-default);font-family:var(--wx-font-family-mono);font-size:var(--wx-font-size-xs);line-height:var(--wx-font-line-height-relaxed);white-space:pre-wrap;word-break:break-all}.wx-connect__links[data-v-19a489e0]{display:flex;flex-wrap:wrap;gap:var(--wx-space-12)}.wx-profile-host[data-v-9583a67a]{container-type:inline-size}.wx-profile[data-v-9583a67a]{display:flex;gap:var(--wx-space-16)}.wx-profile__aside[data-v-9583a67a]{flex:0 0 180px}.wx-profile__fields[data-v-9583a67a]{display:flex;flex-direction:column;gap:var(--wx-space-12);flex:1 1 auto;min-width:0}@container (max-width: 480px){.wx-profile[data-v-9583a67a]{flex-direction:column}.wx-profile__aside[data-v-9583a67a]{flex:none}}.wx-user-menu__theme[data-v-22dfea95]{padding:var(--wx-space-2) var(--wx-space-8) var(--wx-space-6)}.wx-user-menu__trigger[data-v-22dfea95]{display:inline-flex;padding:0;border:none;border-radius:var(--wx-radius-full);background:transparent;cursor:pointer;transition:opacity var(--wx-duration-fast) var(--wx-easing-standard)}.wx-user-menu__trigger[data-v-22dfea95]:hover{opacity:.85}.wx-user-menu__trigger[data-v-22dfea95]:focus-visible{outline:2px solid var(--wx-border-focus);outline-offset:2px}.wx-user-menu__trigger--named[data-v-22dfea95]{align-items:center;gap:var(--wx-space-8);width:100%;min-width:0;padding:var(--wx-space-4);border-radius:var(--wx-radius-control);text-align:start}.wx-user-menu__trigger--named[data-v-22dfea95]:hover{opacity:1;background:var(--wx-bg-subtle)}.wx-user-menu__who[data-v-22dfea95]{display:flex;flex:1 1 auto;flex-direction:column;min-width:0;font-family:var(--wx-font-family-sans);line-height:1.3}.wx-user-menu__name[data-v-22dfea95],.wx-user-menu__email[data-v-22dfea95]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wx-user-menu__name[data-v-22dfea95]{color:var(--wx-text-default);font-size:var(--wx-font-size-sm);font-weight:var(--wx-font-weight-medium)}.wx-user-menu__email[data-v-22dfea95]{color:var(--wx-text-muted);font-size:var(--wx-font-size-xs)}.wx-user-menu__chevron[data-v-22dfea95]{flex:none;color:var(--wx-text-muted)}
|
package/dist/types.d.ts
CHANGED
|
@@ -149,3 +149,50 @@ export interface Connections {
|
|
|
149
149
|
canSeeEverybody: boolean;
|
|
150
150
|
}
|
|
151
151
|
export type ConnectionScope = 'mine' | 'all';
|
|
152
|
+
/**
|
|
153
|
+
* A key for a program, as `GET /api/cms/auth/keys` answers it.
|
|
154
|
+
*
|
|
155
|
+
* `user` is who the key acts as; `created_by` is who issued it, and is null for a key issued in
|
|
156
|
+
* a terminal. `everything` stands for `mcp:use` — whatever the administrator may do, modules
|
|
157
|
+
* installed later included. The secret is never here: it is shown once, when the key is issued.
|
|
158
|
+
*/
|
|
159
|
+
export interface McpKey {
|
|
160
|
+
id: number;
|
|
161
|
+
name: string;
|
|
162
|
+
user: {
|
|
163
|
+
id: number;
|
|
164
|
+
name: string | null;
|
|
165
|
+
};
|
|
166
|
+
created_by: {
|
|
167
|
+
id: number;
|
|
168
|
+
name: string | null;
|
|
169
|
+
} | null;
|
|
170
|
+
scopes: string[];
|
|
171
|
+
everything: boolean;
|
|
172
|
+
state: 'live' | 'expired' | 'revoked';
|
|
173
|
+
created_at: string | null;
|
|
174
|
+
expires_at: string | null;
|
|
175
|
+
last_used_at: string | null;
|
|
176
|
+
revoked_at: string | null;
|
|
177
|
+
[key: string]: unknown;
|
|
178
|
+
}
|
|
179
|
+
/** The list, with what a key may be issued with. */
|
|
180
|
+
export interface McpKeys {
|
|
181
|
+
data: McpKey[];
|
|
182
|
+
/** Every scope the server would accept, `mcp:use` — everything — among them. */
|
|
183
|
+
scopes: string[];
|
|
184
|
+
/** The longest a key may live, in days. */
|
|
185
|
+
maxDays: number;
|
|
186
|
+
}
|
|
187
|
+
/** What issuing a key takes. No scopes means everything the administrator may do. */
|
|
188
|
+
export interface McpKeyInput {
|
|
189
|
+
name: string;
|
|
190
|
+
admin: number;
|
|
191
|
+
scopes: string[];
|
|
192
|
+
days: number;
|
|
193
|
+
}
|
|
194
|
+
/** A key just issued, and the one moment its secret exists outside the program. */
|
|
195
|
+
export interface IssuedMcpKey {
|
|
196
|
+
key: McpKey;
|
|
197
|
+
token: string;
|
|
198
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webx-ui/module-auth",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.1",
|
|
4
4
|
"description": "Signing in to a WebX UI admin panel: the screen, the session and the router guard. Pairs with webx-ui/module-auth on the server.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"vue-router": "^4.5.0"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@webx-ui/module-admin": "^0.
|
|
47
|
+
"@webx-ui/module-admin": "^0.28.0",
|
|
48
48
|
"@webx-ui/core": "^0.41.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|