@frigear-nu/oauth-server 0.1.2 → 0.1.3
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/module.d.mts +8 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +24 -20
- package/dist/runtime/app/composables/useOAuthApplicationActions.d.ts +3 -0
- package/dist/runtime/app/composables/useOAuthApplicationActions.js +29 -13
- package/dist/runtime/app/composables/useOAuthApplications.d.ts +15 -14
- package/dist/runtime/app/composables/useOAuthApplications.js +25 -14
- package/dist/runtime/app/pages/admin.vue +113 -62
- package/dist/runtime/app/pages/applications.vue +51 -34
- package/dist/runtime/app/pages/authorize.vue +3 -2
- package/dist/runtime/i18n/lang/da.json +6 -1
- package/dist/runtime/i18n/lang/en.json +6 -1
- package/dist/runtime/server/middleware/oauth-cors.js +6 -5
- package/dist/runtime/server/routes/api/admin/application-revoke.post.js +5 -3
- package/dist/runtime/server/routes/api/admin/application-secret.post.js +3 -1
- package/dist/runtime/server/routes/api/admin/application.delete.js +4 -3
- package/dist/runtime/server/routes/api/admin/application.get.js +6 -3
- package/dist/runtime/server/routes/api/admin/application.patch.js +4 -3
- package/dist/runtime/server/routes/api/admin/applications.get.js +20 -8
- package/dist/runtime/server/routes/api/admin/applications.post.js +3 -3
- package/dist/runtime/server/routes/api/consent.get.js +4 -3
- package/dist/runtime/server/routes/oidc/authorize.get.js +5 -6
- package/dist/runtime/server/routes/oidc/authorize.post.js +1 -2
- package/dist/runtime/server/routes/oidc/openid-configuration.get.js +6 -5
- package/dist/runtime/server/routes/oidc/revoke.post.js +15 -3
- package/dist/runtime/server/routes/oidc/token.post.js +20 -5
- package/dist/runtime/server/utils/oauth-access.d.ts +2 -0
- package/dist/runtime/server/utils/oauth-access.js +7 -1
- package/dist/runtime/server/utils/oauth-applications.d.ts +7 -2
- package/dist/runtime/server/utils/oauth-applications.js +39 -12
- package/dist/runtime/server/utils/oauth-authorize.d.ts +8 -4
- package/dist/runtime/server/utils/oauth-authorize.js +10 -8
- package/dist/runtime/server/utils/oauth-config.d.ts +5 -0
- package/dist/runtime/server/utils/oauth-config.js +5 -0
- package/dist/runtime/server/utils/oauth-keys.js +3 -2
- package/dist/runtime/utils/api.d.ts +28 -0
- package/dist/runtime/utils/api.js +27 -0
- package/dist/runtime/utils/index.d.ts +1 -0
- package/dist/runtime/utils/index.js +1 -0
- package/dist/types.d.mts +1 -1
- package/package.json +14 -9
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
const enc = encodeURIComponent;
|
|
2
|
+
export const oauthServerApi = {
|
|
3
|
+
/** `GET`: data for the consent screen (the authorization request's parameters as the query). */
|
|
4
|
+
consent: "/api/oauth-server/consent",
|
|
5
|
+
me: {
|
|
6
|
+
/** `GET`: the applications the signed-in user may sign in to. */
|
|
7
|
+
applications: "/api/oauth-server/me/applications"
|
|
8
|
+
},
|
|
9
|
+
admin: {
|
|
10
|
+
/** `GET` (paginated) and `POST` (create, 201). */
|
|
11
|
+
applications: "/api/admin/oauth-server/applications",
|
|
12
|
+
/** `GET`, `PATCH`, `DELETE` (204). */
|
|
13
|
+
application: (id) => `/api/admin/oauth-server/applications/${enc(id)}`,
|
|
14
|
+
/** `POST`: replaces the client secret and answers `{ clientSecret }` once. */
|
|
15
|
+
rotateSecret: (id) => `/api/admin/oauth-server/applications/${enc(id)}/secret`,
|
|
16
|
+
/** `POST`: signs everyone out of the application; answers the application. */
|
|
17
|
+
revoke: (id) => `/api/admin/oauth-server/applications/${enc(id)}/revoke`
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
export const oidc = {
|
|
21
|
+
configuration: "/.well-known/openid-configuration",
|
|
22
|
+
jwks: "/.well-known/jwks.json",
|
|
23
|
+
authorize: "/oauth/authorize",
|
|
24
|
+
token: "/oauth/token",
|
|
25
|
+
revoke: "/oauth/revoke",
|
|
26
|
+
userinfo: "/oauth/userinfo"
|
|
27
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export type * from '../../types';
|
|
2
|
+
export { oauthServerApi, oidc } from './api.js';
|
|
2
3
|
export declare const DEFAULT_SCOPES: readonly ["openid", "profile", "email"];
|
|
3
4
|
export declare const DEFAULT_CALLBACK_PATH = "/auth/frigear";
|
|
4
5
|
/** `confidential` clients hold a secret; `public` clients (native and single-page apps) cannot and rely on PKCE alone. */
|
package/dist/types.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { default } from './module.mjs'
|
|
2
2
|
|
|
3
|
-
export { type AdminApplicationDto, type ApplicationAccessContext, type ApplicationInput, type AuthorizeContext, type ClaimsContext, type ClientType, type ConsentDto, type CreatedApplicationDto, type ModuleOptions, type OAuthApplication, type OAuthServerRuntimeConfig, type OAuthUser, type PublicModuleOptions, type TokenIssuedContext, type TokenRevokedContext, type TokenType, type UserApplicationDto, type UserRolesContext } from './module.mjs'
|
|
3
|
+
export { type AdminApplicationDto, type AdminApplicationsPage, type ApplicationAccessContext, type ApplicationInput, type AuthorizeContext, type ClaimsContext, type ClientType, type ConsentDto, type CreatedApplicationDto, type ModuleOptions, type OAuthApplication, type OAuthServerRuntimeConfig, type OAuthUser, type PublicModuleOptions, type TokenIssuedContext, type TokenRevokedContext, type TokenType, type UserApplicationDto, type UserRolesContext } from './module.mjs'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frigear-nu/oauth-server",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "OAuth 2.0 / OpenID Connect server for the frigear ecosystem: register applications that users with certain roles may sign in to.",
|
|
5
5
|
"url": "https://docs.frigear.dev/modules/oauth-server",
|
|
6
6
|
"author": {
|
|
@@ -28,6 +28,11 @@
|
|
|
28
28
|
"types": "./dist/runtime/utils/index.d.ts",
|
|
29
29
|
"import": "./dist/runtime/utils/index.js",
|
|
30
30
|
"default": "./dist/runtime/utils/index.js"
|
|
31
|
+
},
|
|
32
|
+
"./api": {
|
|
33
|
+
"types": "./dist/runtime/utils/api.d.ts",
|
|
34
|
+
"import": "./dist/runtime/utils/api.js",
|
|
35
|
+
"default": "./dist/runtime/utils/api.js"
|
|
31
36
|
}
|
|
32
37
|
},
|
|
33
38
|
"files": [
|
|
@@ -37,12 +42,12 @@
|
|
|
37
42
|
"playground"
|
|
38
43
|
],
|
|
39
44
|
"dependencies": {
|
|
40
|
-
"@frigear-nu/admin": "0.1.
|
|
41
|
-
"@frigear-nu/module-kit": "1.1.
|
|
42
|
-
"@frigear-nu/ui": "0.1.
|
|
43
|
-
"@frigear-nu/auth": "0.1.
|
|
44
|
-
"@frigear-nu/mcp": "0.1.
|
|
45
|
-
"@frigear-nu/users": "1.1.
|
|
45
|
+
"@frigear-nu/admin": "0.1.3",
|
|
46
|
+
"@frigear-nu/module-kit": "1.1.3",
|
|
47
|
+
"@frigear-nu/ui": "0.1.3",
|
|
48
|
+
"@frigear-nu/auth": "0.1.4",
|
|
49
|
+
"@frigear-nu/mcp": "0.1.3",
|
|
50
|
+
"@frigear-nu/users": "1.1.4",
|
|
46
51
|
"@libsql/client": "^0.18.0",
|
|
47
52
|
"@nuxt/kit": "^4.6.1",
|
|
48
53
|
"drizzle-kit": "^0.31.11",
|
|
@@ -52,7 +57,7 @@
|
|
|
52
57
|
"zod": "^4.6.5"
|
|
53
58
|
},
|
|
54
59
|
"peerDependencies": {
|
|
55
|
-
"@frigear-nu/menu": "0.1.
|
|
60
|
+
"@frigear-nu/menu": "0.1.3",
|
|
56
61
|
"@nuxt/ui": "^4.12.0",
|
|
57
62
|
"@nuxthub/core": "^0.10.8"
|
|
58
63
|
},
|
|
@@ -65,7 +70,7 @@
|
|
|
65
70
|
}
|
|
66
71
|
},
|
|
67
72
|
"devDependencies": {
|
|
68
|
-
"@frigear-nu/menu": "0.1.
|
|
73
|
+
"@frigear-nu/menu": "0.1.3",
|
|
69
74
|
"@nuxt/devtools": "^3.4.2",
|
|
70
75
|
"@nuxt/eslint-config": "^1.17.0",
|
|
71
76
|
"@nuxt/module-builder": "^1.0.3",
|