Skip to content
This repository was archived by the owner on Nov 5, 2024. It is now read-only.

feat: add helper for sqlite credential store #2

Merged
merged 3 commits into from
Sep 23, 2024
Merged

feat: add helper for sqlite credential store #2

merged 3 commits into from
Sep 23, 2024

Conversation

g-linville
Copy link
Member

@g-linville g-linville commented Sep 20, 2024

This is a new application to support using a local SQLite database for credential storage with GPTScript. It works just like the Docker credential helpers that we use, and implements the same interface.

I have not integrated this as a credential store option in GPTScript yet. That is the next step for me. I wanted to get the code up here in order to make testing a bit easier.

I'll add some documentation about how to use this and how to set up encryption configuration once I have everything working.

Signed-off-by: Grant Linville <[email protected]>
type GptscriptCredential struct {
ID uint `gorm:"primary_key"`
CreatedAt time.Time
ServerURL string `gorm:"unique"`

Choose a reason for hiding this comment

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

What is the serverURL in credential?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is so that we fit logically with how credentials work for the Docker credential helpers. Each Docker credential includes a server URL, username, and password. The server URL is basically the URL of the container store. In our case we use the server URL as a combination of the credential context and credential name. But the translation of that is handled in GPTScript itself, not here in the helper.

Choose a reason for hiding this comment

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

thanks for the explanation!

@g-linville g-linville merged commit 194fe51 into gptscript-ai:main Sep 23, 2024
@g-linville g-linville deleted the init branch September 23, 2024 18:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants