Skip to content
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

Query as API #165

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Conversation

breadchris
Copy link
Contributor

Resolves #164

DestinationID uint
Destination Destination `gorm:"constraint:OnDelete:CASCADE"`
HashedAPIKey string `gorm:"index"`
// If the API key is specific to a saved query
SavedQueryID uint
Copy link
Contributor

Choose a reason for hiding this comment

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

One comment here (I realize this is copied from my existing branch.) I'd started to refactor this so that the APIKey table does not have a SavedQuery, and instead use a Join table, ie, apikey_savedquery. Then I just added an APIKey "type" (QUERY, GENERAL - or something more descriptive) that tells me about who the key belongs to.

This also then lets me create a single API key and give it access to multiple endpoints. And it didn't make sense the QueryParams be in this table either since it's such a specific use case.

@breadchris breadchris marked this pull request as ready for review April 19, 2024 17:30
@breadchris breadchris mentioned this pull request Apr 20, 2024
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.

Queries as an API
2 participants