fix: make client credential optional in authcode + pkce flow (#4114)

* fix: make client credential optional

* test: update test fixtures

---------

Co-authored-by: jamesgeorge007 <25279263+jamesgeorge007@users.noreply.github.com>
This commit is contained in:
Akash K
2024-06-12 14:10:54 +05:30
committed by GitHub
parent e3ad0c9e2e
commit 93807bfe8f
7 changed files with 140 additions and 20 deletions

View File

@@ -4,6 +4,7 @@ import V1_VERSION from "./v/1"
import V2_VERSION from "./v/2"
import V3_VERSION from "./v/3"
import V4_VERSION from "./v/4"
import V5_VERSION from "./v/5"
export { GQLHeader } from "./v/1"
export {
@@ -13,23 +14,24 @@ export {
HoppGQLAuthInherit,
} from "./v/2"
export { HoppGQLAuth } from "./v/4"
export { HoppGQLAuthOAuth2 } from "./v/3"
export { HoppGQLAuthOAuth2, HoppGQLAuth } from "./v/5"
export { HoppGQLAuthAPIKey } from "./v/4"
export const GQL_REQ_SCHEMA_VERSION = 4
export const GQL_REQ_SCHEMA_VERSION = 5
const versionedObject = z.object({
v: z.number(),
})
export const HoppGQLRequest = createVersionedEntity({
latestVersion: 4,
latestVersion: 5,
versionMap: {
1: V1_VERSION,
2: V2_VERSION,
3: V3_VERSION,
4: V4_VERSION,
5: V5_VERSION,
},
getVersion(x) {
const result = versionedObject.safeParse(x)