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
base: main
Are you sure you want to change the base?
Query as API #165
Conversation
DestinationID uint | ||
Destination Destination `gorm:"constraint:OnDelete:CASCADE"` | ||
HashedAPIKey string `gorm:"index"` | ||
// If the API key is specific to a saved query | ||
SavedQueryID uint |
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.
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.
Resolves #164