Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@antn
Copy link
Member

@antn antn commented Nov 20, 2025

Toward AUTH-5512.

Description

Contains:

Documentation

Does this require changes to the WorkOS Docs? E.g. the API Reference or code snippets need updates.

[ ] Yes

If yes, link a related docs PR and add a docs maintainer as a reviewer. Their approval is required.

@antn antn self-assigned this Nov 20, 2025
@antn antn requested a review from a team as a code owner November 20, 2025 12:13
@antn antn requested a review from nicknisi November 20, 2025 12:13
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Nov 20, 2025

Greptile Overview

Greptile Summary

This release bumps the SDK version to 7.74.0 and includes two new features: the ability to resend user invitations and automatic idempotency key generation for audit log events.

  • Added resendInvitation() method to UserManagement API for resending invitations with proper error handling for expired, revoked, or accepted invitations
  • Implemented automatic idempotency key generation (workos-node-{uuid}) for audit log event creation to ensure safe retries
  • Added retry support for audit log events on transient failures (500, 502, 504, 408 status codes) with up to 3 retry attempts
  • Updated version constants and test snapshots across the codebase to reflect the new version

The changes follow established patterns in the codebase and include comprehensive test coverage. No security concerns were identified.

Confidence Score: 5/5

  • This PR is safe to merge with no concerns
  • This is a straightforward version bump PR that consolidates two previously reviewed and merged PRs. All changes are limited to version number updates in package.json, source constant, and test snapshots. The underlying functionality (resend invitations and auto-idempotency keys) was already merged to main. No custom security rules were violated, and all changes follow the established codebase patterns.
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
package.json 5/5 Version bumped from 7.73.0 to 7.74.0 for release
src/workos.ts 5/5 VERSION constant updated from 7.73.0 to 7.74.0 to match package version
src/sso/snapshots/sso.spec.ts.snap 5/5 Test snapshots updated to reflect new User-Agent header with version 7.74.0

Sequence Diagram

sequenceDiagram
    participant Client
    participant UserManagement
    participant AuditLogs
    participant API

    Note over Client,API: v7.74.0 Release Changes

    rect rgb(200, 220, 255)
        Note right of Client: Feature 1: Resend Invitation
        Client->>UserManagement: resendInvitation(invitationId)
        UserManagement->>API: POST /user_management/invitations/{id}/resend
        alt Invitation Valid
            API-->>UserManagement: 200 OK (Invitation)
            UserManagement-->>Client: Invitation object
        else Invitation Not Found
            API-->>UserManagement: 404 Not Found
            UserManagement-->>Client: Throw error
        else Invitation Expired/Revoked/Accepted
            API-->>UserManagement: 400 Bad Request
            UserManagement-->>Client: Throw error
        end
    end

    rect rgb(220, 255, 220)
        Note right of Client: Feature 2: Auto-generated Idempotency Keys
        Client->>AuditLogs: createEvent(org, event)
        Note over AuditLogs: Auto-generate idempotency key<br/>with workos-node prefix
        AuditLogs->>API: POST /audit_logs/events<br/>with Idempotency-Key header
        alt Success
            API-->>AuditLogs: 201 Created
            AuditLogs-->>Client: void
        else Retryable Error (500, 502, 504, 408)
            API-->>AuditLogs: 5xx/408 Error
            Note over AuditLogs: Retry with same key<br/>(max 3 retries)
            AuditLogs->>API: POST /audit_logs/events<br/>with same Idempotency-Key
            API-->>AuditLogs: 201 Created
            AuditLogs-->>Client: void
        end
    end
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

2 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@linear
Copy link

linear bot commented Nov 20, 2025

@antn
Copy link
Member Author

antn commented Nov 21, 2025

This ended up being bumped in #1393.

@antn antn closed this Nov 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants