Skip to content

Add support for service accounts#1485

Merged
shangyian merged 9 commits intoDataJunction:mainfrom
shangyian:service-account
Sep 4, 2025
Merged

Add support for service accounts#1485
shangyian merged 9 commits intoDataJunction:mainfrom
shangyian:service-account

Conversation

@shangyian
Copy link
Copy Markdown
Collaborator

@shangyian shangyian commented Sep 2, 2025

Summary

This PR adds support for service accounts, which will enable programmatic clients to authenticate and interact with DJ. This setup has service accounts modeled as a part of the users table for simplicity, and they're identified with the kind flag. Any given service account has to be created with an authenticated identity, which is represented by the created_by_id field.

This change includes API endpoints for:

  • Creating a new service account.
  • Generating authentication tokens for service accounts. These bearer tokens have a configurable expiration period and can be used to make subsequent calls to the DJ API.

Test Plan

Deployment Plan

@netlify
Copy link
Copy Markdown

netlify bot commented Sep 2, 2025

Deploy Preview for thriving-cassata-78ae72 canceled.

Name Link
🔨 Latest commit 88782e5
🔍 Latest deploy log https://app.netlify.com/projects/thriving-cassata-78ae72/deploys/68b91d1316471c00082b4838

@shangyian shangyian force-pushed the service-account branch 2 times, most recently from 7164852 to 7820c3f Compare September 2, 2025 20:17
@shangyian shangyian force-pushed the service-account branch 2 times, most recently from 1c84bd3 to 2c2c872 Compare September 2, 2025 21:30
@shangyian shangyian marked this pull request as ready for review September 3, 2025 05:31
@shangyian shangyian merged commit 6fbf3e5 into DataJunction:main Sep 4, 2025
17 checks passed
Copy link
Copy Markdown
Member

@agorajek agorajek left a comment

Choose a reason for hiding this comment

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

Ah, forgot to review yday... just added one question inline.

nullable=True,
)

created_by: Mapped["User"] = relationship("User")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

How is this different from created_by_id ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This is the ORM reference to the User object, similar to how created_nodes works on the user class as well.

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.

2 participants