fix(management_api): decode identity_id in CreateUserIdentity response - #62
fix(management_api): decode identity_id in CreateUserIdentity response#62dtoxvanilla1991 wants to merge 1 commit into
Conversation
The Kinde API returns identity_id instead of id when creating an identity for an existing enterprise connection. The published OpenAPI spec still only documents id, so ogen never generates identity_id on its own. Add fix_identity_id.go, a go:generate patch step (matching the existing fix_optstring.go / fix_oneof.go convention) that adds IdentityID to CreateIdentityResponseIdentity and teaches the encoder/decoder about the identity_id key. Add EffectiveIdentityID() helper to read whichever field the API populated. Reimplements #60 without vendoring a local copy of the spec, avoiding an unrelated full SDK regen/breaking changes. Test file carried over from that PR. Co-authored-by: BrandtKruger <brandt.kruger087@gmail.com>
|
Warning Review limit reachedNext included review available in 54 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (7)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
shafaladhikari
left a comment
There was a problem hiding this comment.
Reviewed and tested on starter kit. Looks good to me.
|
This can be closed. I tried reproducing the bug using the API by creating an identity using an enterprise connection ID, but got back "id" as the parameter instead of "identity_id". |
Explain your changes
Supersedes #60. The Kinde API returns
identity_idinstead ofidwhen creating an identity for an existing enterprise connection. The published OpenAPI spec still only documentsid, soogennever generatesidentity_idon its own, and decoding such a response previously dropped the identity ID entirely.This reimplements #60's fix with a much smaller footprint:
ogen --cleanagainst it, which regenerated the entire SDK and pulled in unrelated, breaking changes (e.g. aDeleteAPIAppliationScope→DeleteAPIApplicationScoperename, a new required field onCreateApiKeyReq) on top of 6 months of spec drift against currentmain.fix_identity_id.go, ago:generatepatch step following the repo's existing convention (fix_optstring.go,fix_oneof.go) that patches just theCreateIdentityResponseIdentitytype to also decodeidentity_id, with no vendored spec and no unrelated regen.EffectiveIdentityID()helper and the full test suite from fix(management_api): CreateUserIdentity response decodes identity_id … #60 are carried over unchanged.Verified against the live spec at
api-spec.kinde.comthatidentity_idis still undocumented upstream, so the underlying bug and fix are still necessary.Checklist