@atproto/oauth-provider 0.7.7 → 0.7.9
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/CHANGELOG.md +16 -0
- package/dist/router/create-account-page-middleware.d.ts.map +1 -1
- package/dist/router/create-account-page-middleware.js +6 -0
- package/dist/router/create-account-page-middleware.js.map +1 -1
- package/dist/types/password.d.ts.map +1 -1
- package/dist/types/password.js +2 -2
- package/dist/types/password.js.map +1 -1
- package/package.json +3 -3
- package/src/router/create-account-page-middleware.ts +8 -0
- package/src/types/password.ts +2 -2
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,21 @@
|
|
1
1
|
# @atproto/oauth-provider
|
2
2
|
|
3
|
+
## 0.7.9
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- [#3900](https://github.com/bluesky-social/atproto/pull/3900) [`06bf684a4`](https://github.com/bluesky-social/atproto/commit/06bf684a4a3fd2b8c73d2729e4951cedca8cba5e) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Add max length limit to passwords
|
8
|
+
|
9
|
+
## 0.7.8
|
10
|
+
|
11
|
+
### Patch Changes
|
12
|
+
|
13
|
+
- [`d1e3e68dd`](https://github.com/bluesky-social/atproto/commit/d1e3e68dd9eb7bed13d9023bc0e4ce3c448eabf5) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Add `/.well-known/change-password` endpoint
|
14
|
+
|
15
|
+
- Updated dependencies [[`d1e3e68dd`](https://github.com/bluesky-social/atproto/commit/d1e3e68dd9eb7bed13d9023bc0e4ce3c448eabf5)]:
|
16
|
+
- @atproto/oauth-provider-frontend@0.1.5
|
17
|
+
- @atproto/oauth-provider-ui@0.1.6
|
18
|
+
|
3
19
|
## 0.7.7
|
4
20
|
|
5
21
|
### Patch Changes
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"create-account-page-middleware.d.ts","sourceRoot":"","sources":["../../src/router/create-account-page-middleware.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAEhE,OAAO,EACL,UAAU,
|
1
|
+
{"version":3,"file":"create-account-page-middleware.d.ts","sourceRoot":"","sources":["../../src/router/create-account-page-middleware.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAEhE,OAAO,EACL,UAAU,EAMX,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAGzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAEhE,wBAAgB,2BAA2B,CACzC,GAAG,SAAS,MAAM,GAAG,IAAI,GAAG,IAAI,EAChC,GAAG,SAAS,eAAe,GAAG,eAAe,EAC7C,GAAG,SAAS,cAAc,GAAG,cAAc,EAE3C,MAAM,EAAE,aAAa,EACrB,EAAE,OAAO,EAAE,EAAE,iBAAiB,CAAC,GAAG,EAAE,GAAG,CAAC,GACvC,UAAU,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAsD3B"}
|
@@ -10,6 +10,12 @@ function createAccountPageMiddleware(server, { onError }) {
|
|
10
10
|
const issuerUrl = new URL(server.issuer);
|
11
11
|
const issuerOrigin = issuerUrl.origin;
|
12
12
|
const router = new index_js_1.Router(issuerUrl);
|
13
|
+
// Create password reset discovery endpoint
|
14
|
+
// https://w3c.github.io/webappsec-change-password-url/
|
15
|
+
router.get('/.well-known/change-password', (_req, res) => {
|
16
|
+
(0, index_js_1.writeRedirect)(res, new URL('/account/reset-password', issuerUrl).toString());
|
17
|
+
});
|
18
|
+
// Create frontend account pages
|
13
19
|
router.get(/^\/account(?:\/.*)?$/, async function (req, res) {
|
14
20
|
try {
|
15
21
|
res.setHeader('Referrer-Policy', 'same-origin');
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"create-account-page-middleware.js","sourceRoot":"","sources":["../../src/router/create-account-page-middleware.ts"],"names":[],"mappings":";;
|
1
|
+
{"version":3,"file":"create-account-page-middleware.js","sourceRoot":"","sources":["../../src/router/create-account-page-middleware.ts"],"names":[],"mappings":";;AAeA,kEA6DC;AA1ED,mDAO6B;AAE7B,wEAAsE;AACtE,oEAAkE;AAGlE,SAAgB,2BAA2B,CAKzC,MAAqB,EACrB,EAAE,OAAO,EAA+B;IAExC,MAAM,eAAe,GAAG,IAAA,6CAAsB,EAAC,MAAM,CAAC,aAAa,CAAC,CAAA;IACpE,MAAM,aAAa,GAAG,IAAA,yCAAoB,EAAC,MAAM,CAAC,aAAa,CAAC,CAAA;IAEhE,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;IACxC,MAAM,YAAY,GAAG,SAAS,CAAC,MAAM,CAAA;IAErC,MAAM,MAAM,GAAG,IAAI,iBAAM,CAAgB,SAAS,CAAC,CAAA;IAEnD,2CAA2C;IAC3C,uDAAuD;IACvD,MAAM,CAAC,GAAG,CAAC,8BAA8B,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE;QACvD,IAAA,wBAAa,EAAC,GAAG,EAAE,IAAI,GAAG,CAAC,yBAAyB,EAAE,SAAS,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAA;IAC9E,CAAC,CAAC,CAAA;IAEF,gCAAgC;IAChC,MAAM,CAAC,GAAG,CAAQ,sBAAsB,EAAE,KAAK,WAAW,GAAG,EAAE,GAAG;QAChE,IAAI,CAAC;YACH,GAAG,CAAC,SAAS,CAAC,iBAAiB,EAAE,aAAa,CAAC,CAAA;YAE/C,GAAG,CAAC,SAAS,CAAC,eAAe,EAAE,UAAU,CAAC,CAAA;YAC1C,GAAG,CAAC,SAAS,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAA;YAEnC,IAAA,4BAAiB,EAAC,GAAG,EAAE,CAAC,UAAU,CAAC,CAAC,CAAA;YACpC,IAAA,4BAAiB,EAAC,GAAG,EAAE,CAAC,UAAU,CAAC,CAAC,CAAA;YACpC,IAAA,yBAAc,EAAC,GAAG,EAAE,YAAY,CAAC,CAAA;YAEjC,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;YAC9D,MAAM,cAAc,GAClB,MAAM,MAAM,CAAC,cAAc,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAA;YAE1D,eAAe,CAAC,GAAG,EAAE,GAAG,EAAE;gBACxB,cAAc,EAAE,cAAc,CAAC,GAAG,CAChC,CAAC,aAAa,EAAuB,EAAE,CAAC,CAAC;oBACvC,OAAO,EAAE,aAAa,CAAC,OAAO;oBAC9B,aAAa,EAAE,MAAM,CAAC,kBAAkB,CAAC,aAAa,CAAC;iBACxD,CAAC,CACH;aACF,CAAC,CAAA;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,EAAE,CACP,GAAG,EACH,GAAG,EACH,GAAG,EACH,2CAA2C,GAAG,CAAC,GAAG,GAAG,CACtD,CAAA;YAED,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC;gBACrB,aAAa,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;YAC9B,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAA;IAEF,OAAO,MAAM,CAAC,eAAe,EAAE,CAAA;AACjC,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"password.d.ts","sourceRoot":"","sources":["../../src/types/password.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,iBAAiB,
|
1
|
+
{"version":3,"file":"password.d.ts","sourceRoot":"","sources":["../../src/types/password.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,iBAAiB,aAA6B,CAAA;AAC3D,eAAO,MAAM,iBAAiB,aAA6B,CAAA"}
|
package/dist/types/password.js
CHANGED
@@ -2,6 +2,6 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.newPasswordSchema = exports.oldPasswordSchema = void 0;
|
4
4
|
const zod_1 = require("zod");
|
5
|
-
exports.oldPasswordSchema = zod_1.z.string().min(1);
|
6
|
-
exports.newPasswordSchema = zod_1.z.string().min(8);
|
5
|
+
exports.oldPasswordSchema = zod_1.z.string().min(1).max(512);
|
6
|
+
exports.newPasswordSchema = zod_1.z.string().min(8).max(256);
|
7
7
|
//# sourceMappingURL=password.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"password.js","sourceRoot":"","sources":["../../src/types/password.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AAEV,QAAA,iBAAiB,GAAG,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;
|
1
|
+
{"version":3,"file":"password.js","sourceRoot":"","sources":["../../src/types/password.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AAEV,QAAA,iBAAiB,GAAG,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;AAC9C,QAAA,iBAAiB,GAAG,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@atproto/oauth-provider",
|
3
|
-
"version": "0.7.
|
3
|
+
"version": "0.7.9",
|
4
4
|
"license": "MIT",
|
5
5
|
"description": "Generic OAuth2 and OpenID Connect provider for Node.js. Currently only supports features needed for Atproto.",
|
6
6
|
"keywords": [
|
@@ -52,8 +52,8 @@
|
|
52
52
|
"@atproto/jwk-jose": "0.1.6",
|
53
53
|
"@atproto/oauth-types": "0.2.7",
|
54
54
|
"@atproto/oauth-provider-api": "0.1.2",
|
55
|
-
"@atproto/oauth-provider-frontend": "0.1.
|
56
|
-
"@atproto/oauth-provider-ui": "0.1.
|
55
|
+
"@atproto/oauth-provider-frontend": "0.1.5",
|
56
|
+
"@atproto/oauth-provider-ui": "0.1.6",
|
57
57
|
"@atproto/syntax": "0.4.0"
|
58
58
|
},
|
59
59
|
"devDependencies": {
|
@@ -6,6 +6,7 @@ import {
|
|
6
6
|
validateFetchDest,
|
7
7
|
validateFetchMode,
|
8
8
|
validateOrigin,
|
9
|
+
writeRedirect,
|
9
10
|
} from '../lib/http/index.js'
|
10
11
|
import type { OAuthProvider } from '../oauth-provider.js'
|
11
12
|
import { sendAccountPageFactory } from './assets/send-account-page.js'
|
@@ -28,6 +29,13 @@ export function createAccountPageMiddleware<
|
|
28
29
|
|
29
30
|
const router = new Router<Ctx, Req, Res>(issuerUrl)
|
30
31
|
|
32
|
+
// Create password reset discovery endpoint
|
33
|
+
// https://w3c.github.io/webappsec-change-password-url/
|
34
|
+
router.get('/.well-known/change-password', (_req, res) => {
|
35
|
+
writeRedirect(res, new URL('/account/reset-password', issuerUrl).toString())
|
36
|
+
})
|
37
|
+
|
38
|
+
// Create frontend account pages
|
31
39
|
router.get<never>(/^\/account(?:\/.*)?$/, async function (req, res) {
|
32
40
|
try {
|
33
41
|
res.setHeader('Referrer-Policy', 'same-origin')
|
package/src/types/password.ts
CHANGED