Skip to content

Conversation

@nimish-ks
Copy link
Member

@nimish-ks nimish-ks commented Oct 13, 2025

🔍 Overview

Fixed the ApolloError: {'expires_at': ['This field cannot be blank.']} when creating Service Account Tokens that do not expire.

💡 Proposed Changes

  • Updated the expires_at field in the ServiceAccountToken model to allow blank values, enhancing flexibility in token management.
  • Added a deprecation comment for legacy app-linked service tokens in the ServiceToken model.

🧪 Testing

  • Create a Service Account Token with no expiry - verify that creation is successful and a valid token is minted
  • Create a Service Account Token with expiry - verify that creation succeeds and a valid token is minted

Note

Permits non-expiring service account tokens by allowing blank expires_at and adds a deprecation note to legacy app-linked service tokens.

  • Backend/models:
    • ServiceAccountToken: set expires_at to blank=True to support non-expiring tokens.
    • ServiceToken: add deprecation comment indicating legacy app-linked tokens.

Written by Cursor Bugbot for commit f6eec58. This will update automatically on new commits. Configure here.

- Added a deprecation comment for legacy app-linked service tokens in the ServiceToken model.
- Updated the expires_at field in the ServiceAccountToken model to allow blank values, enhancing flexibility in token management.
@nimish-ks nimish-ks self-assigned this Oct 13, 2025
@nimish-ks
Copy link
Member Author

@cursor review

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no bugs!


@rohan-chaturvedi
Copy link
Member

This is a bandaid fix that will require a migration, and allow blank values for the expiry that we do want to allow. Made a separate fix in #665

@nimish-ks nimish-ks deleted the fix--service-account-token-creation branch October 13, 2025 17:44
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