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 methods for Token CRUD API endpoints #131

Merged
merged 2 commits into from
Oct 2, 2019

Conversation

phamann
Copy link
Member

@phamann phamann commented Sep 25, 2019

TL;DR

Adds methods to expose API Token management (list, get, create, delete) endpoints: https://docs.fastly.com/api/auth#tokens.

Notes:

  • Upgrades the go-vcr dependency to take advantage of the AddFilter method on the recorder instance to automatically strip API keys from requests.
  • Cleaned token credentials form all test recordings
  • Didn't implement the batch endpoint

Copy link

@peterbourgon peterbourgon left a comment

Choose a reason for hiding this comment

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

:shipit:

fastly/token.go Outdated Show resolved Hide resolved
fastly/token.go Outdated Show resolved Hide resolved
@phamann phamann force-pushed the phamann/get-token-self branch 2 times, most recently from b1b4317 to cf06cec Compare September 25, 2019 15:26
r.AddFilter(func(i *cassette.Interaction) error {
delete(i.Request.Headers, "Fastly-Key")
return nil
})
Copy link
Member

Choose a reason for hiding this comment

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

👏 Why didn't we implement this earlier 😭

@phamann
Copy link
Member Author

phamann commented Sep 26, 2019

@philippschulte thanks for the review, let me know if you want me to merge this and cut a release or if you want to?

@philippschulte
Copy link
Member

@phamann thanks for fixing the build by updating the dependencies. I am happy to take care of the release! However, there is one more step you'll need to do in order to wrap this PR up. Please run $ go mod tidy in order to clean up go.sum. This will remove:

-github.com/dnaeon/go-vcr v0.0.0-20170218072653-87d4990451a8 h1:9W38WyoOkLTitPbj0ltn6yE4PrZ2WJrxUh06pwdKjCQ=
-github.com/dnaeon/go-vcr v0.0.0-20170218072653-87d4990451a8/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E=

Thanks in advance.

@phamann
Copy link
Member Author

phamann commented Oct 2, 2019

@philippschulte Apologies for the delay, I have now tidied the go.sum file.

@philippschulte philippschulte merged commit 3a56f1e into master Oct 2, 2019
@philippschulte philippschulte deleted the phamann/get-token-self branch October 2, 2019 16:18
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.

None yet

3 participants