make kestrel a tak server, so that it can send and receive pois as cots data
Some checks failed
ci/woodpecker/pr/pr Pipeline failed

This commit is contained in:
Madison Grubb
2026-02-17 10:42:53 -05:00
parent b18283d3b3
commit b0e8dd7ad9
96 changed files with 5767 additions and 500 deletions

View File

@@ -6,6 +6,8 @@ import {
getCodeChallenge,
getOidcRedirectUri,
getOidcConfig,
buildAuthorizeUrl,
exchangeCode,
} from '../../server/utils/oidc.js'
describe('oidc', () => {
@@ -121,5 +123,31 @@ describe('oidc', () => {
const config = await getOidcConfig()
expect(config).toBeNull()
})
it('returns null when only some OIDC env vars set', async () => {
process.env.OIDC_ISSUER = 'https://idp.example.com'
process.env.OIDC_CLIENT_ID = 'client'
delete process.env.OIDC_CLIENT_SECRET
const config = await getOidcConfig()
expect(config).toBeNull()
delete process.env.OIDC_ISSUER
delete process.env.OIDC_CLIENT_ID
})
})
describe('buildAuthorizeUrl', () => {
it('is a function that accepts config and params', () => {
expect(typeof buildAuthorizeUrl).toBe('function')
expect(buildAuthorizeUrl.length).toBe(2)
})
})
describe('exchangeCode', () => {
it('rejects when grant fails', async () => {
const config = {}
const currentUrl = 'https://app/api/auth/oidc/callback?code=abc&state=s'
const checks = { state: 's', nonce: 'n', codeVerifier: 'v' }
await expect(exchangeCode(config, currentUrl, checks)).rejects.toBeDefined()
})
})
})