Skip to content

fix(management_api): decode identity_id in CreateUserIdentity response - #62

Closed
dtoxvanilla1991 wants to merge 1 commit into
mainfrom
fix/create-user-identity-identity-id
Closed

fix(management_api): decode identity_id in CreateUserIdentity response#62
dtoxvanilla1991 wants to merge 1 commit into
mainfrom
fix/create-user-identity-identity-id

Conversation

@dtoxvanilla1991

@dtoxvanilla1991 dtoxvanilla1991 commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Explain your changes

Supersedes #60. 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, and decoding such a response previously dropped the identity ID entirely.

This reimplements #60's fix with a much smaller footprint:

  • fix(management_api): CreateUserIdentity response decodes identity_id … #60 vendored a local copy of the full management API spec and ran ogen --clean against it, which regenerated the entire SDK and pulled in unrelated, breaking changes (e.g. a DeleteAPIAppliationScopeDeleteAPIApplicationScope rename, a new required field on CreateApiKeyReq) on top of 6 months of spec drift against current main.
  • Instead, this PR adds fix_identity_id.go, a go:generate patch step following the repo's existing convention (fix_optstring.go, fix_oneof.go) that patches just the CreateIdentityResponseIdentity type to also decode identity_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.com that identity_id is still undocumented upstream, so the underlying bug and fix are still necessary.

Checklist

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>
@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 54 minutes.

View limit details

Limit 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.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e9e6ddef-510e-40cf-8837-ad62088ddac1

📥 Commits

Reviewing files that changed from the base of the PR and between e816055 and 4176782.

📒 Files selected for processing (7)
  • CHANGELOG.md
  • kinde/management_api/create_identity_response_helpers.go
  • kinde/management_api/create_identity_response_test.go
  • kinde/management_api/fix_identity_id.go
  • kinde/management_api/generate.go
  • kinde/management_api/oas_json_gen.go
  • kinde/management_api/oas_schemas_gen.go

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@shafaladhikari shafaladhikari left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed and tested on starter kit. Looks good to me.

@victoreronmosele

Copy link
Copy Markdown
Member

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".

@dtoxvanilla1991
dtoxvanilla1991 deleted the fix/create-user-identity-identity-id branch August 29, 2026 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants