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

add Secret Store implementation #19

Merged
merged 4 commits into from
Jan 20, 2023
Merged

add Secret Store implementation #19

merged 4 commits into from
Jan 20, 2023

Conversation

joeshaw
Copy link
Member

@joeshaw joeshaw commented Nov 30, 2022

This adds hostcall and SDK support for the Fastly Secret Store. An
example is included for usage but the basic idea is:

st, err := secretstore.Open("example_secretstore")
if err != nil {
    panic(err)
}

s, err := st.Get("my_secret")
if err != nil {
    panic(err)
}

pt, err := s.Plaintext()
if err != nil {
    panic(err)
}

fmt.Fprintf(w, "secret value: %q", v)

@joeshaw
Copy link
Member Author

joeshaw commented Nov 30, 2022

Still to do: Viceroy doesn't have support for these hostcalls yet, so the example is expected to fail on it. Looks like we need an integration test for it as well (which I would expect to fail for now).

@joeshaw
Copy link
Member Author

joeshaw commented Dec 1, 2022

Viceroy PR: fastly/Viceroy#210

@joeshaw joeshaw added the blocked label Dec 5, 2022
@joeshaw joeshaw force-pushed the joeshaw/secret-store-sdk branch 2 times, most recently from 3c058bd to 2c4b7cf Compare January 20, 2023 19:36
@joeshaw joeshaw removed the blocked label Jan 20, 2023
@joeshaw joeshaw force-pushed the joeshaw/secret-store-sdk branch 2 times, most recently from 00ac085 to 9ddfe44 Compare January 20, 2023 20:04
@joeshaw joeshaw marked this pull request as ready for review January 20, 2023 20:26
This adds hostcall and SDK support for the Fastly Secret Store.  An
example is included for usage but the basic idea is:

```go
st, err := secretstore.Open("example_secretstore")
if err != nil {
    panic(err)
}

s, err := st.Get("my_secret")
if err != nil {
    panic(err)
}

pt, err := s.Plaintext()
if err != nil {
    panic(err)
}

fmt.Fprintf(w, "secret value: %q", v)
```
@joeshaw joeshaw force-pushed the joeshaw/secret-store-sdk branch from 9ddfe44 to ee90fe3 Compare January 20, 2023 20:48
Copy link
Member

@dgryski dgryski left a comment

Choose a reason for hiding this comment

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

LGTM

@joeshaw joeshaw merged commit 03174b6 into main Jan 20, 2023
@joeshaw joeshaw deleted the joeshaw/secret-store-sdk branch January 20, 2023 20:58
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