-
Notifications
You must be signed in to change notification settings - Fork 72
Support Ephemeral Lifetime configuration in the Tenant Settings #614
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: v1
Are you sure you want to change the base?
Support Ephemeral Lifetime configuration in the Tenant Settings #614
Conversation
|
Hi @nelsonmaia, We shouldn’t add custom logic in SDKs, such as:
These changes will be lost in the generated SDK. Currently, the SDK is just a wrapper on top of the API, so any custom logic should live in the API itself rather than the SDK. |
|
@developerkunal I just replicated the same behaviour for the GetIdleSessionLifetime and GetSessionLifetime, maybe my comment was confusing but I just used the same pattenr that the same fields have already |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for ephemeral session lifetime settings in the Auth0 tenant management SDK. These new fields allow configuration of session timeouts for non-persistent sessions.
- Adds
EphemeralSessionLifetimeandIdleEphemeralSessionLifetimefields to the Tenant struct - Implements custom marshaling logic to handle hour-to-minute conversion for values < 1
- Updates test recordings and adds test coverage for the new fields
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| management/tenant.go | Adds new ephemeral session lifetime fields and marshaling logic |
| management/tenant_test.go | Adds test cases for ephemeral session lifetime fields and marshaling |
| management/management.gen.go | Auto-generated getter methods for new fields |
| management/management.gen_test.go | Auto-generated test coverage for new getter methods |
| test/data/recordings/TestTenantManager.yaml | Updated test recordings with new API responses |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| assert.Equal(t, newTenantSettings.GetDefaultTokenQuota().GetOrganizations().GetClientCredentials(), actualTenantSettings.GetDefaultTokenQuota().GetOrganizations().GetClientCredentials()) | ||
| assert.Equal(t, newTenantSettings.GetEphemeralSessionLifetime(), actualTenantSettings.GetEphemeralSessionLifetime()) | ||
| assert.Equal(t, newTenantSettings.GetIdleEphemeralSessionLifetime(), actualTenantSettings.GetIdleEphemeralSessionLifetime()) | ||
| assert.Equal(t, actualTenantSettings.GetIdleEphemeralSessionLifetime(), 0.25) // rounded if necessary |
Copilot
AI
Oct 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment 'rounded if necessary' is misleading. Based on line 37 where IdleEphemeralSessionLifetime is set to 0.25 and the marshaling logic that converts values < 1 to minutes (15 minutes in this case), the value should remain 0.25 hours when read back. The comment should clarify that this verifies the value is correctly preserved through the round-trip, not that rounding occurred.
| assert.Equal(t, actualTenantSettings.GetIdleEphemeralSessionLifetime(), 0.25) // rounded if necessary | |
| assert.Equal(t, actualTenantSettings.GetIdleEphemeralSessionLifetime(), 0.25) // verifies value is preserved through round-trip (should remain 0.25 hours) |
🔧 Changes
This PR adds support for two new tenant-level session configuration fields to the
Tenantresource:ephemeral_session_lifetimeidle_ephemeral_session_lifetimeThese fields allow customers to configure the absolute and idle timeouts for ephemeral (non-persistent) sessions.
Changes include:
Tenantstruct intenant.goMarshalJSON()to support_in_minutesbehavior for values less than 1 hour (mirroring existing session fields)make generateTestTenantManager) to validate read/write behavior of the new fieldsTestTenant_MarshalJSONto test marshaling logic for hour- and minute-based values📚 References
🔬 Testing
make test-record FILTER=TestTenantManagerto verify update and read-back of new fieldsMarshalJSONlogic correctly routes values to*_in_minuteswhen below 1 hour📝 Checklist