@@ -14,6 +14,18 @@ describe("auth plugin - actions", () => {
14
14
{
15
15
oas3 : true ,
16
16
server : "https://host/resource" ,
17
+ effectiveServer : "https://host/resource" ,
18
+ scheme : "http" ,
19
+ host : null ,
20
+ url : "http://specs/file" ,
21
+ } ,
22
+ "https://host/authorize"
23
+ ] ,
24
+ [
25
+ {
26
+ oas3 : true ,
27
+ server : "https://{selected_host}/resource" ,
28
+ effectiveServer : "https://host/resource" ,
17
29
scheme : "http" ,
18
30
host : null ,
19
31
url : "http://specs/file" ,
@@ -24,6 +36,7 @@ describe("auth plugin - actions", () => {
24
36
{
25
37
oas3 : false ,
26
38
server : null ,
39
+ effectiveServer : null ,
27
40
scheme : "https" ,
28
41
host : undefined ,
29
42
url : "https://specs/file" ,
@@ -34,13 +47,14 @@ describe("auth plugin - actions", () => {
34
47
{
35
48
oas3 : false ,
36
49
server : null ,
50
+ effectiveServer : null ,
37
51
scheme : "https" ,
38
52
host : "host" ,
39
53
url : "http://specs/file" ,
40
54
} ,
41
55
"http://specs/authorize"
42
56
] ,
43
- ] . forEach ( ( [ { oas3, server, scheme, host, url} , expectedFetchUrl ] ) => {
57
+ ] . forEach ( ( [ { oas3, server, effectiveServer , scheme, host, url} , expectedFetchUrl ] ) => {
44
58
it ( "should resolve authorization endpoint against the server URL" , ( ) => {
45
59
46
60
// Given
@@ -56,7 +70,8 @@ describe("auth plugin - actions", () => {
56
70
getConfigs : ( ) => ( { } )
57
71
} ,
58
72
oas3Selectors : {
59
- selectedServer : ( ) => server
73
+ selectedServer : ( ) => server ,
74
+ serverEffectiveValue : ( ) => effectiveServer || server
60
75
} ,
61
76
specSelectors : {
62
77
isOAS3 : ( ) => oas3 ,
@@ -130,7 +145,8 @@ describe("auth plugin - actions", () => {
130
145
} )
131
146
} ,
132
147
oas3Selectors : {
133
- selectedServer : ( ) => "http://google.com"
148
+ selectedServer : ( ) => "http://google.com" ,
149
+ serverEffectiveValue : ( ) => "http://google.com"
134
150
} ,
135
151
specSelectors : {
136
152
isOAS3 : ( ) => true ,
@@ -150,13 +166,13 @@ describe("auth plugin - actions", () => {
150
166
151
167
describe ( "tokenRequest" , function ( ) {
152
168
it ( "should send the code verifier when set" , ( ) => {
153
- const data = {
169
+ const data = {
154
170
auth : {
155
171
schema : {
156
172
get : ( ) => "http://tokenUrl"
157
173
} ,
158
174
codeVerifier : "mock_code_verifier"
159
- } ,
175
+ } ,
160
176
redirectUrl : "http://google.com"
161
177
}
162
178
0 commit comments