-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
adbc25f
commit 957126e
Showing
5 changed files
with
89 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Copyright (c) 2024, salesforce.com, inc. | ||
* All rights reserved. | ||
* Licensed under the BSD 3-Clause license. | ||
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause | ||
*/ | ||
import { expect } from 'chai'; | ||
import { WebOAuthServer } from '../../src/webOAuthServer'; | ||
import { JwtOAuth2Config } from '../../src/org/authInfo'; | ||
|
||
describe('web Oauth server', () => { | ||
const oauthConfig: JwtOAuth2Config = { | ||
loginUrl: 'https://login.salesforce.com', | ||
}; | ||
|
||
let oauthServer: WebOAuthServer; | ||
|
||
before(async () => { | ||
oauthServer = await WebOAuthServer.create({ oauthConfig }); | ||
await oauthServer.start(); | ||
await oauthServer.authorizeAndSave(); | ||
}); | ||
|
||
after(() => { | ||
oauthServer.close(); | ||
}); | ||
|
||
it('handle preflight request', async () => { | ||
const accessControlHeaders = new Headers({ | ||
'access-control-request-private-network': 'true', | ||
'access-control-request-method': 'GET', | ||
}); | ||
|
||
const res = await fetch('http://localhost:1717', { | ||
method: 'OPTIONS', | ||
headers: accessControlHeaders, | ||
}); | ||
|
||
expect(res.status).to.equal(204); | ||
expect(res.headers.get('Access-Control-Allow-Methods')).to.equal('GET'); | ||
expect(res.headers.get('Access-Control-Request-Headers')).to.equal('GET'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
957126e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Logger Benchmarks - ubuntu-latest
Child logger creation
481245
ops/sec (±1.15%
)470064
ops/sec (±2.33%
)0.98
Logging a string on root logger
867291
ops/sec (±7.71%
)814225
ops/sec (±7.51%
)0.94
Logging an object on root logger
634587
ops/sec (±7.51%
)646849
ops/sec (±6.66%
)1.02
Logging an object with a message on root logger
28376
ops/sec (±182.18%
)4901
ops/sec (±217.88%
)0.17
Logging an object with a redacted prop on root logger
476031
ops/sec (±9.00%
)461432
ops/sec (±7.36%
)0.97
Logging a nested 3-level object on root logger
28194
ops/sec (±181.85%
)391701
ops/sec (±8.24%
)13.89
This comment was automatically generated by workflow using github-action-benchmark.
957126e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible performance regression was detected for benchmark 'Logger Benchmarks - ubuntu-latest'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold
2
.Logging a nested 3-level object on root logger
28194
ops/sec (±181.85%
)391701
ops/sec (±8.24%
)13.89
This comment was automatically generated by workflow using github-action-benchmark.
957126e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Logger Benchmarks - windows-latest
Child logger creation
339301
ops/sec (±0.45%
)339507
ops/sec (±0.34%
)1.00
Logging a string on root logger
810289
ops/sec (±6.91%
)759702
ops/sec (±5.85%
)0.94
Logging an object on root logger
625189
ops/sec (±8.05%
)580922
ops/sec (±4.24%
)0.93
Logging an object with a message on root logger
5018
ops/sec (±211.61%
)10866
ops/sec (±189.68%
)2.17
Logging an object with a redacted prop on root logger
473631
ops/sec (±6.97%
)369307
ops/sec (±9.30%
)0.78
Logging a nested 3-level object on root logger
337499
ops/sec (±5.71%
)275550
ops/sec (±6.29%
)0.82
This comment was automatically generated by workflow using github-action-benchmark.
957126e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible performance regression was detected for benchmark 'Logger Benchmarks - windows-latest'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold
2
.Logging an object with a message on root logger
5018
ops/sec (±211.61%
)10866
ops/sec (±189.68%
)2.17
This comment was automatically generated by workflow using github-action-benchmark.