openid 2.0.11 → 2.0.12

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/package.json CHANGED
@@ -18,7 +18,7 @@
18
18
  "name": "Håvard Stranden",
19
19
  "email": "havard.stranden@gmail.com"
20
20
  },
21
- "version": "2.0.11",
21
+ "version": "2.0.12",
22
22
  "repository": {
23
23
  "type": "git",
24
24
  "url": "http://github.com/havard/node-openid.git"
@@ -36,15 +36,10 @@
36
36
  "node": ">= 0.6.0"
37
37
  },
38
38
  "devDependencies": {
39
- "jest": "^26.6.3"
39
+ "jest": "^29.7.0"
40
40
  },
41
41
  "dependencies": {
42
42
  "axios": "^1.6.0",
43
43
  "qs": "^6.5.2"
44
- },
45
- "jest": {
46
- "moduleNameMapper": {
47
- "axios": "axios/dist/node/axios.cjs"
48
- }
49
44
  }
50
45
  }
@@ -55,36 +55,49 @@ test('Empty identifier', () => {
55
55
  // // });
56
56
  // // });
57
57
 
58
- // test('Resolve Steam', () => {
59
- // openid.discover('https://steamcommunity.com/openid',
60
- // true,
61
- // (error, providers) => {
62
- // expect(error).toBeFalsy();
63
- // expect(providers.length).toBe(1);
64
- // });
65
- // });
58
+ test('Resolve Steam', () => {
59
+ openid.discover('https://steamcommunity.com/openid/',
60
+ true,
61
+ (error, providers) => {
62
+ expect(error).toBeFalsy();
63
+ expect(providers.length).toBe(1);
64
+ });
65
+ });
66
66
 
67
- // test('Resolve LiveJournal user', () => {
68
- // openid.discover('http://omnifarious.livejournal.com/',
69
- // true,
70
- // (error, providers) => {
71
- // expect(error).toBeFalsy();
72
- // expect(providers.length).toBe(1);
73
- // });
74
- // });
67
+ test('Resolve https://login.ubuntu.com', () => {
68
+ openid.discover('https://login.ubuntu.com',
69
+ true,
70
+ (error, providers) => {
71
+ expect(error).toBeFalsy();
72
+ expect(providers.length).toBe(1);
73
+ });
74
+ });
75
75
 
76
- // test('Resolve OpenID 1.1 provider', () => {
76
+ test('Resolve LiveJournal user', () => {
77
+ openid.discover('http://omnifarious.livejournal.com/',
78
+ true,
79
+ (error, providers) => {
80
+ expect(error).toBeFalsy();
81
+ expect(providers.length).toBe(1);
82
+ });
83
+ });
84
+
85
+ // 2023-11-12: This OpenID 1.1 provider seems to have gone away,
86
+ // so disable this test for now.
87
+ // test('Resolve OpenID 1.1 provider', done => {
77
88
  // // FIXME: relying on a third party for back-level protocol support is brittle.
78
89
  // openid.discover('http://pupeno.com/',
79
90
  // true,
80
91
  // (error, providers) => {
81
92
  // expect(error).toBeFalsy();
82
- // expect(providers.length).toBe(1);
93
+ // expect(providers).not.toBeNull();
94
+ // expect(providers).toHaveLength(1);
83
95
  // expect(providers[0].version).toBe('http://openid.net/signon/1.1');
96
+ // done();
84
97
  // });
85
98
  // });
86
99
 
87
- const performAssociation = (url, version) => {
100
+ const performAssociation = (url, version, done) => {
88
101
  openid.discover(url,
89
102
  true,
90
103
  (error, providers) => {
@@ -98,51 +111,56 @@ const performAssociation = (url, version) => {
98
111
  expect(provider.version).toBe(version);
99
112
  }
100
113
  expect(result.expires_in).toBeTruthy();
114
+ done();
101
115
  });
102
116
  }
103
117
  );
104
118
  }
105
119
 
106
- // test('Associate with https://login.ubuntu.com', () => {
107
- // performAssociation('https://login.ubuntu.com');
108
- // });
120
+ test('Associate with https://login.ubuntu.com', done => {
121
+ performAssociation('https://login.ubuntu.com',null, done);
122
+ });
109
123
 
110
- // test('Associate with http://omnifarious.livejournal.com/', () => {
111
- // performAssociation('http://omnifarious.livejournal.com/');
112
- // });
113
- // test('Associate with https://matt.wordpress.com/', () => {
114
- // // FIXME: relying on a third party for back-level protocol support is brittle.
115
- // performAssociation('https://matt.wordpress.com/', 'http://openid.net/signon/1.1', test);
116
- // });
124
+ test('Associate with http://omnifarious.livejournal.com/', done => {
125
+ performAssociation('http://omnifarious.livejournal.com/', null, done);
126
+ });
117
127
 
118
- // test('Immediate authentication with https://login.ubuntu.com', () => {
119
- // openid.authenticate('https://login.ubuntu.com',
120
- // 'http://example.com/verify', null, true, false,
121
- // (error, url) => {
122
- // expect(error).toBeFalsy();
123
- // expect(url.indexOf('checkid_immediate')).not.toBe(-1);
124
- // });
125
- // });
128
+ test('Associate with https://matt.wordpress.com/', done => {
129
+ // FIXME: relying on a third party for back-level protocol support is brittle.
130
+ performAssociation('https://matt.wordpress.com/', 'http://openid.net/signon/1.1', done);
131
+ });
126
132
 
127
- // test('Setup authentication with https://login.ubuntu.com', () => {
128
- // openid.authenticate('https://login.ubuntu.com',
129
- // 'http://example.com/verify', null, false, false,
130
- // (error, url) => {
131
- // expect(error).toBeFalsy();
132
- // expect(url.indexOf('checkid_setup')).not.toBe(-1);
133
- // });
134
- // });
133
+ test('Immediate authentication with https://login.ubuntu.com', done => {
134
+ openid.authenticate('https://login.ubuntu.com',
135
+ 'http://example.com/verify', null, true, false,
136
+ (error, url) => {
137
+ expect(error).toBeFalsy();
138
+ expect(url.indexOf('checkid_immediate')).not.toBe(-1);
139
+ done();
140
+ });
141
+ });
135
142
 
136
- // test('Setup authentication with https://login.ubuntu.com using RelyingParty object', () => {
137
- // const rp = new openid.RelyingParty(
138
- // 'http://example.com/verify',
139
- // null,
140
- // false,
141
- // false,
142
- // null);
143
- // rp.authenticate('https://login.ubuntu.com', false,
144
- // (error, url) => {
145
- // expect(error).toBeFalsy();
146
- // expect(url.indexOf('checkid_setup')).not.toBe(-1);
147
- // });
148
- // });
143
+ test('Setup authentication with https://login.ubuntu.com', done => {
144
+ openid.authenticate('https://login.ubuntu.com',
145
+ 'http://example.com/verify', null, false, false,
146
+ (error, url) => {
147
+ expect(error).toBeFalsy();
148
+ expect(url.indexOf('checkid_setup')).not.toBe(-1);
149
+ done();
150
+ });
151
+ });
152
+
153
+ test('Setup authentication with https://login.ubuntu.com using RelyingParty object', done => {
154
+ const rp = new openid.RelyingParty(
155
+ 'http://example.com/verify',
156
+ null,
157
+ false,
158
+ false,
159
+ null);
160
+ rp.authenticate('https://login.ubuntu.com', false,
161
+ (error, url) => {
162
+ expect(error).toBeFalsy();
163
+ expect(url.indexOf('checkid_setup')).not.toBe(-1);
164
+ done();
165
+ });
166
+ });
@@ -1,13 +0,0 @@
1
- {
2
- // Use IntelliSense to learn about possible attributes.
3
- // Hover to view descriptions of existing attributes.
4
- // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5
- "version": "0.2.0",
6
- "configurations": [{
7
- "command": "npm test",
8
- "name": "Run npm test",
9
- "request": "launch",
10
- "type": "node-terminal"
11
- },
12
- ]
13
- }