@solid/oidc-auth-manager 0.24.5 → 0.25.0-0e9ec48e
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/LICENSE.md +0 -0
- package/README.md +0 -0
- package/coverage/base.css +224 -0
- package/coverage/block-navigation.js +87 -0
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +146 -0
- package/coverage/prettify.css +1 -0
- package/coverage/prettify.js +2 -0
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +210 -0
- package/coverage/src/errors/auth-response-sent.js.html +118 -0
- package/coverage/src/errors/index.html +116 -0
- package/coverage/src/handlers/auth-callback-request.js.html +586 -0
- package/coverage/src/handlers/index.html +161 -0
- package/coverage/src/handlers/login-consent-request.js.html +514 -0
- package/coverage/src/handlers/logout-request.js.html +271 -0
- package/coverage/src/handlers/select-provider-request.js.html +748 -0
- package/coverage/src/host-api.js.html +424 -0
- package/coverage/src/index.html +161 -0
- package/coverage/src/oidc-manager.js.html +1603 -0
- package/coverage/src/preferred-provider.js.html +520 -0
- package/coverage/src/user-store.js.html +1120 -0
- package/package.json +17 -15
- package/src/errors/auth-response-sent.js +0 -0
- package/src/handlers/auth-callback-request.js +0 -0
- package/src/handlers/index.js +0 -0
- package/src/handlers/login-consent-request.js +6 -8
- package/src/handlers/logout-request.js +0 -0
- package/src/handlers/select-provider-request.js +0 -0
- package/src/host-api.js +4 -6
- package/src/index.js +0 -0
- package/src/oidc-manager.js +0 -0
- package/src/preferred-provider.js +0 -0
- package/src/user-store.js +0 -0
- package/test/integration/oidc-manager-test.js +0 -0
- package/test/integration/user-store-test.js +0 -0
- package/test/resources/sample-webid-profile-with-oidc-issuer.js +0 -0
- package/test/resources/sample-webid-profile.js +0 -0
- package/test/unit/auth-callback-request.js +0 -0
- package/test/unit/auth-success-exception.js +0 -0
- package/test/unit/host-api-test.js +0 -0
- package/test/unit/login-consent-request.js +0 -0
- package/test/unit/logout-request.js +0 -0
- package/test/unit/oidc-manager-test.js +0 -0
- package/test/unit/preferred-provider-test.js +0 -0
- package/test/unit/select-provider-request.js +0 -0
- package/test/unit/user-store-test.js +2 -2
- package/.github/workflows/ci.yml +0 -59
- package/.travis.yml +0 -8
package/package.json
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solid/oidc-auth-manager",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.25.0-0e9ec48e",
|
|
4
4
|
"description": "An OpenID Connect (OIDC) authentication manager (OP, RP and RS) for decentralized peer-to-peer authentication",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "echo nothing to build",
|
|
8
8
|
"standard": "standard",
|
|
9
|
+
"standard-fix": "standard --fix",
|
|
9
10
|
"test": "npm run standard && npm run mocha",
|
|
10
11
|
"mocha": "nyc mocha --exit --recursive --timeout 20000",
|
|
11
12
|
"preversion": "npm test",
|
|
12
|
-
"postversion": "git push --follow-tags"
|
|
13
|
+
"postversion": "git push --follow-tags",
|
|
14
|
+
"ignore:prepublishOnly": "npm test"
|
|
13
15
|
},
|
|
14
16
|
"engines": {
|
|
15
17
|
"node": ">=8.10"
|
|
@@ -39,33 +41,33 @@
|
|
|
39
41
|
},
|
|
40
42
|
"homepage": "https://github.com/solid/oidc-auth-manager",
|
|
41
43
|
"dependencies": {
|
|
42
|
-
"@solid/oidc-op": "^0.
|
|
43
|
-
"@solid/oidc-rp": "^0.
|
|
44
|
-
"@solid/oidc-rs": "^0.
|
|
45
|
-
"@solid/solid-multi-rp-client": "
|
|
46
|
-
"ajv": "^
|
|
47
|
-
"bcryptjs": "^
|
|
48
|
-
"fs-extra": "^
|
|
44
|
+
"@solid/oidc-op": "^0.12.0",
|
|
45
|
+
"@solid/oidc-rp": "^0.12.0",
|
|
46
|
+
"@solid/oidc-rs": "^0.7.0",
|
|
47
|
+
"@solid/solid-multi-rp-client": "0.7.0",
|
|
48
|
+
"ajv": "^8.17.1",
|
|
49
|
+
"bcryptjs": "^3.0.3",
|
|
50
|
+
"fs-extra": "^11.3.3",
|
|
49
51
|
"kvplus-files": "0.0.4",
|
|
50
52
|
"li": "^1.3.0",
|
|
51
53
|
"node-fetch": "^2.7.0",
|
|
52
|
-
"rdflib": "^2.3.
|
|
54
|
+
"rdflib": "^2.3.2",
|
|
53
55
|
"valid-url": "^1.0.9"
|
|
54
56
|
},
|
|
55
57
|
"devDependencies": {
|
|
56
58
|
"chai": "^4.5.0",
|
|
57
59
|
"chai-as-promised": "^7.1.2",
|
|
58
60
|
"dirty-chai": "^2.0.1",
|
|
59
|
-
"mocha": "^
|
|
60
|
-
"nock": "^
|
|
61
|
+
"mocha": "^11.7.5",
|
|
62
|
+
"nock": "^14.0.10",
|
|
61
63
|
"node-mocks-http": "^1.17.2",
|
|
62
|
-
"nyc": "^
|
|
64
|
+
"nyc": "^17.1.0",
|
|
63
65
|
"sinon": "^9.2.4",
|
|
64
66
|
"sinon-chai": "^3.7.0",
|
|
65
67
|
"solid-auth-cli": "^1.0.15",
|
|
66
68
|
"solid-auth-client": "^2.5.6",
|
|
67
|
-
"standard": "^
|
|
68
|
-
"whatwg-url": "^
|
|
69
|
+
"standard": "^17.1.2",
|
|
70
|
+
"whatwg-url": "^15.1.0"
|
|
69
71
|
},
|
|
70
72
|
"nyc": {
|
|
71
73
|
"reporter": [
|
|
File without changes
|
|
File without changes
|
package/src/handlers/index.js
CHANGED
|
File without changes
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
'use strict'
|
|
2
|
-
/* eslint-disable node/no-deprecated-api */
|
|
3
2
|
|
|
4
3
|
const AuthResponseSent = require('../errors/auth-response-sent')
|
|
5
|
-
const url = require('url')
|
|
6
4
|
|
|
7
5
|
class LoginConsentRequest {
|
|
8
6
|
constructor (options) {
|
|
@@ -66,8 +64,8 @@ class LoginConsentRequest {
|
|
|
66
64
|
static obtainConsent (consentRequest) {
|
|
67
65
|
const { opAuthRequest, clientId } = consentRequest
|
|
68
66
|
|
|
69
|
-
const parsedAppOrigin =
|
|
70
|
-
const appOrigin =
|
|
67
|
+
const parsedAppOrigin = new URL(consentRequest.opAuthRequest.params.redirect_uri)
|
|
68
|
+
const appOrigin = parsedAppOrigin.origin
|
|
71
69
|
|
|
72
70
|
// Consent for the local RP client (the home pod) is implied
|
|
73
71
|
if (consentRequest.isLocalRpClient(appOrigin)) {
|
|
@@ -126,10 +124,10 @@ class LoginConsentRequest {
|
|
|
126
124
|
|
|
127
125
|
redirectToConsent (authRequest) {
|
|
128
126
|
const { opAuthRequest } = this
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
consentUrl =
|
|
127
|
+
console.log('Redirecting user to /sharing')
|
|
128
|
+
console.log(opAuthRequest.host)
|
|
129
|
+
const queryString = new URLSearchParams(opAuthRequest.req.query).toString()
|
|
130
|
+
const consentUrl = `/sharing${queryString ? '?' + queryString : ''}`
|
|
133
131
|
opAuthRequest.subject = null
|
|
134
132
|
|
|
135
133
|
opAuthRequest.res.redirect(consentUrl)
|
|
File without changes
|
|
File without changes
|
package/src/host-api.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
'use strict'
|
|
2
|
-
/* eslint-disable node/no-deprecated-api */
|
|
3
|
-
|
|
4
|
-
const url = require('url')
|
|
5
2
|
|
|
6
3
|
const LogoutRequest = require('./handlers/logout-request')
|
|
7
4
|
const LoginConsentRequest = require('./handlers/login-consent-request')
|
|
@@ -44,10 +41,11 @@ function authenticate (authRequest) {
|
|
|
44
41
|
}
|
|
45
42
|
|
|
46
43
|
function redirectToLogin (authRequest) {
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
console.log('Redirecting user to /login')
|
|
45
|
+
console.log(authRequest.host)
|
|
49
46
|
|
|
50
|
-
|
|
47
|
+
const queryString = new URLSearchParams(authRequest.req.query).toString()
|
|
48
|
+
const loginUrl = `/login${queryString ? '?' + queryString : ''}`
|
|
51
49
|
authRequest.subject = null
|
|
52
50
|
|
|
53
51
|
authRequest.res.redirect(loginUrl)
|
package/src/index.js
CHANGED
|
File without changes
|
package/src/oidc-manager.js
CHANGED
|
File without changes
|
|
File without changes
|
package/src/user-store.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -194,7 +194,7 @@ describe('UserStore', () => {
|
|
|
194
194
|
|
|
195
195
|
it('should look up user record by normalized email', () => {
|
|
196
196
|
const email = 'alice@example.com'
|
|
197
|
-
const user = { id: 'abc', email
|
|
197
|
+
const user = { id: 'abc', email }
|
|
198
198
|
|
|
199
199
|
store.backend.get = sinon.stub().resolves(user)
|
|
200
200
|
|
|
@@ -242,7 +242,7 @@ describe('UserStore', () => {
|
|
|
242
242
|
|
|
243
243
|
store.backend.del = sinon.stub()
|
|
244
244
|
|
|
245
|
-
return store.deleteUser({ id: userId, email
|
|
245
|
+
return store.deleteUser({ id: userId, email })
|
|
246
246
|
.then(() => {
|
|
247
247
|
expect(store.backend.del).to.have.been.calledWith('users', UserStore.normalizeIdKey(userId))
|
|
248
248
|
expect(store.backend.del).to.have.been.calledWith('users-by-email', UserStore.normalizeEmailKey(email))
|
package/.github/workflows/ci.yml
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
|
|
2
|
-
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
|
|
3
|
-
|
|
4
|
-
name: CI
|
|
5
|
-
permissions:
|
|
6
|
-
contents: write
|
|
7
|
-
pull-requests: write
|
|
8
|
-
on:
|
|
9
|
-
push:
|
|
10
|
-
branches:
|
|
11
|
-
- "**"
|
|
12
|
-
pull_request:
|
|
13
|
-
branches:
|
|
14
|
-
- "**"
|
|
15
|
-
workflow_dispatch:
|
|
16
|
-
|
|
17
|
-
jobs:
|
|
18
|
-
build:
|
|
19
|
-
|
|
20
|
-
runs-on: ubuntu-latest
|
|
21
|
-
|
|
22
|
-
strategy:
|
|
23
|
-
matrix:
|
|
24
|
-
node-version:
|
|
25
|
-
- 18.x
|
|
26
|
-
- 20.x
|
|
27
|
-
- 22.x
|
|
28
|
-
|
|
29
|
-
steps:
|
|
30
|
-
- uses: actions/checkout@v5
|
|
31
|
-
- name: Use Node.js ${{ matrix.node-version }}
|
|
32
|
-
uses: actions/setup-node@v6
|
|
33
|
-
with:
|
|
34
|
-
node-version: ${{ matrix.node-version }}
|
|
35
|
-
- run: npm ci
|
|
36
|
-
- run: npm run lint --if-present
|
|
37
|
-
- run: npm test
|
|
38
|
-
- run: npm run build --if-present
|
|
39
|
-
- name: Save build
|
|
40
|
-
if: matrix.node-version == '20.x'
|
|
41
|
-
uses: actions/upload-artifact@v5
|
|
42
|
-
with:
|
|
43
|
-
name: build
|
|
44
|
-
path: |
|
|
45
|
-
.
|
|
46
|
-
!node_modules
|
|
47
|
-
retention-days: 1
|
|
48
|
-
|
|
49
|
-
dependabot:
|
|
50
|
-
name: 'Dependabot'
|
|
51
|
-
needs: build # After the E2E and build jobs, if one of them fails, it won't merge the PR.
|
|
52
|
-
runs-on: ubuntu-latest
|
|
53
|
-
if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}} # Detect that the PR author is dependabot
|
|
54
|
-
steps:
|
|
55
|
-
- name: Enable auto-merge for Dependabot PRs
|
|
56
|
-
run: gh pr merge --auto --merge "$PR_URL" # Use Github CLI to merge automatically the PR
|
|
57
|
-
env:
|
|
58
|
-
PR_URL: ${{github.event.pull_request.html_url}}
|
|
59
|
-
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|