@solid/oidc-auth-manager 0.24.1 → 0.24.2

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/.travis.yml CHANGED
File without changes
package/LICENSE.md CHANGED
File without changes
package/README.md CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solid/oidc-auth-manager",
3
- "version": "0.24.1",
3
+ "version": "0.24.2",
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": {
@@ -39,7 +39,7 @@
39
39
  },
40
40
  "homepage": "https://github.com/solid/oidc-auth-manager",
41
41
  "dependencies": {
42
- "@solid/oidc-op": "^0.11.1",
42
+ "@solid/oidc-op": "^0.11.6",
43
43
  "@solid/oidc-rp": "^0.11.5",
44
44
  "@solid/oidc-rs": "^0.5.5",
45
45
  "@solid/solid-multi-rp-client": "^0.6.4",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/src/host-api.js CHANGED
File without changes
package/src/index.js CHANGED
File without changes
File without changes
@@ -62,9 +62,9 @@ function providerExists (uri) {
62
62
  * provider URI was found, reject with an error.
63
63
  */
64
64
  function discoverProviderFor (webId) {
65
- return discoverFromHeaders(webId)
65
+ return discoverFromProfile(webId)
66
66
 
67
- .then(providerFromHeaders => providerFromHeaders || discoverFromProfile(webId))
67
+ .then(providerFromProfile => providerFromProfile || discoverFromHeaders(webId))
68
68
 
69
69
  .then(providerUri => {
70
70
  validateProviderUri(providerUri, webId) // Throw an error if empty or invalid
package/src/user-store.js CHANGED
File without changes
File without changes
File without changes
@@ -0,0 +1,19 @@
1
+ module.exports = `
2
+ @prefix solid: <http://www.w3.org/ns/solid/terms#>.
3
+ @prefix foaf: <http://xmlns.com/foaf/0.1/>.
4
+ @prefix pim: <http://www.w3.org/ns/pim/space#>.
5
+ @prefix schema: <http://schema.org/>.
6
+ @prefix ldp: <http://www.w3.org/ns/ldp#>.
7
+
8
+ <>
9
+ a foaf:PersonalProfileDocument ;
10
+ foaf:primaryTopic <#me> .
11
+
12
+ <#me>
13
+ a schema:Person ;
14
+
15
+ solid:account </> ; # link to the account uri
16
+ pim:storage </> ; # root storage
17
+
18
+ solid:oidcIssuer <https://provider.com> .
19
+ `
@@ -13,7 +13,5 @@ module.exports = `
13
13
  a schema:Person ;
14
14
 
15
15
  solid:account </> ; # link to the account uri
16
- pim:storage </> ; # root storage
17
-
18
- solid:oidcIssuer <https://provider.com> .
16
+ pim:storage </> . # root storage
19
17
  `
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -14,6 +14,8 @@ chai.should()
14
14
 
15
15
  const OidcManager = require('../../src/oidc-manager')
16
16
 
17
+ const sampleProfileSrc = require('../resources/sample-webid-profile')
18
+
17
19
  describe('OidcManager', () => {
18
20
  afterEach(() => {
19
21
  nock.cleanAll()
@@ -252,6 +254,10 @@ describe('OidcManager', () => {
252
254
  sub: 'https://example.com/profile#me'
253
255
  }
254
256
 
257
+ nock('https://example.com')
258
+ .get('/profile')
259
+ .reply(200, sampleProfileSrc)
260
+
255
261
  nock('https://example.com')
256
262
  .options('/profile')
257
263
  .reply(204, 'No content', {
@@ -270,6 +276,10 @@ describe('OidcManager', () => {
270
276
  sub: 'https://example.com/profile#me'
271
277
  }
272
278
 
279
+ nock('https://example.com')
280
+ .get('/profile')
281
+ .reply(200, sampleProfileSrc)
282
+
273
283
  nock('https://example.com')
274
284
  .options('/profile')
275
285
  .reply(204, 'No content', {
@@ -12,6 +12,7 @@ const expect = chai.expect
12
12
  const serverUri = 'https://example.com'
13
13
 
14
14
  const sampleProfileSrc = require('../resources/sample-webid-profile')
15
+ const sampleProfileSrcWithOidcIssuer = require('../resources/sample-webid-profile-with-oidc-issuer')
15
16
 
16
17
  describe('preferred-provider.js', () => {
17
18
  afterEach(() => {
@@ -22,6 +23,10 @@ describe('preferred-provider.js', () => {
22
23
  const webId = 'https://example.com/#me'
23
24
 
24
25
  it('should extract and validate the provider uri from link rel header', () => {
26
+ nock('https://example.com')
27
+ .get('/')
28
+ .reply(200, sampleProfileSrc)
29
+
25
30
  nock(serverUri)
26
31
  .options('/')
27
32
  .reply(204, 'No content', {
@@ -35,6 +40,10 @@ describe('preferred-provider.js', () => {
35
40
  })
36
41
 
37
42
  it('should not drop the path from extracted provider uri', () => {
43
+ nock('https://example.com')
44
+ .get('/')
45
+ .reply(200, sampleProfileSrc)
46
+
38
47
  nock(serverUri)
39
48
  .options('/')
40
49
  .reply(204, 'No content', {
@@ -48,13 +57,9 @@ describe('preferred-provider.js', () => {
48
57
  })
49
58
 
50
59
  it('should extract and validate the provider uri from the webid profile', () => {
51
- nock(serverUri)
52
- .options('/')
53
- .reply(204, 'No content')
54
-
55
60
  nock(serverUri)
56
61
  .get('/')
57
- .reply(200, sampleProfileSrc, {
62
+ .reply(200, sampleProfileSrcWithOidcIssuer, {
58
63
  'Content-Type': 'text/turtle'
59
64
  })
60
65
 
@@ -147,6 +152,10 @@ describe('preferred-provider.js', () => {
147
152
  })
148
153
 
149
154
  it('should discover preferred provider if no oidc capability at webid', () => {
155
+ nock('https://example.com')
156
+ .get('/profile')
157
+ .reply(200, sampleProfileSrc)
158
+
150
159
  nock('https://example.com')
151
160
  .head('/.well-known/openid-configuration')
152
161
  .reply(404)
File without changes
File without changes