Releases: speakeasy-api/speakeasy-go-sdk
Releases · speakeasy-api/speakeasy-go-sdk
v1.8.1: update gin dependency
feat: update gin dependency
v1.8.0: add support for retrieving path hints from a provided openapi document
Merge pull request #27 from speakeasy-api/add-openapi-support feat: add support for retrieving path hints from an openapi document
v1.7.0: added support for net/http ServeMux routers
This release adds support for routers based on the std lib net/http ServeMux in addition to the DefaultServerMux like DataDog's httptrace ServeMux https://pkg.go.dev/gopkg.in/DataDog/[email protected]/contrib/net/http
v1.6.0: drop support for go < v1.16.x due to updated dependencies
Merge pull request #22 from speakeasy-api/dependabot/go_modules/githu… …b.com/labstack/echo/v4-4.9.0 chore(deps): bump github.com/labstack/echo/v4 from 4.7.2 to 4.9.0
v1.5.1: Enable GRPC Connection pooling
- feat: Enable GRPC Connection pooling by @ThomasRooney in #23
- chore: prefer panic on dial error by @ThomasRooney in #24
v1.4.4: Updates to test suite and minor fixes to header handling
Merge pull request #21 from speakeasy-api/update-tests chore: update SDK with latest test-suite output
v1.3.3: Add timeout to ingest rpc
This release adds a timeout to the ingest request, insuring that these request don't back up in the case of increasing latency
Fix: Improved handling of proxied urls
Merge pull request #19 from speakeasy-api/improve-url-parsing fix: handle url resolution correctly
Fix: Better resolution of relative URLs and URLs behind proxies
Merge pull request #18 from speakeasy-api/fix-url-resolving fix: fixes resolving some relative and proxied URLs
Getting an Embed Access Token
The Speakeasy SDK now supports retrieving an access token for use with our Embedded Request Viewer feature.
Embedded Request Viewer Access Tokens
The Speakeasy SDK can generate access tokens for the Embedded Request Viewer that can be used to view requests captured by the SDK.
For documentation on how to configure filters, find that HERE.
Below are some examples on how to generate access tokens:
import "github.com/speakeasy-api/speakeasy-schemas/grpc/go/registry/embedaccesstoken"
ctx := context.Background()
// If the SDK is configured as a global instance, an access token can be generated using the `GenerateAccessToken` function on the speakeasy package.
accessToken, err := speakeasy.GetEmbedAccessToken(ctx, &embedaccesstoken.EmbedAccessTokenRequest{
Filters: []*embedaccesstoken.EmbedAccessTokenRequest_Filter{
{
Key: "customer_id",
Operator: "=",
Value: "a-customer-id",
},
},
})
// If you have followed the `Advanced Configuration` section above you can also generate an access token using the `GenerateAccessToken` function on the sdk instance.
accessToken, err := storeSDKInstance.GetEmbedAccessToken(ctx, &embedaccesstoken.EmbedAccessTokenRequest{
Filters: []*embedaccesstoken.EmbedAccessTokenRequest_Filter{
{
Key: "customer_id",
Operator: "=",
Value: "a-customer-id",
},
},
})
// Or finally if you have a handler that you would like to generate an access token from, you can get the SDK instance for that handler from the middleware controller and use the `GetEmbedAccessToken` function it.
func MyHandler(w http.ResponseWriter, r *http.Request) {
ctrl := speakeasy.MiddlewareController(req)
accessToken, err := ctrl.GetSDKInstance().GetEmbedAccessToken(ctx, &embedaccesstoken.EmbedAccessTokenRequest{
Filters: []*embedaccesstoken.EmbedAccessTokenRequest_Filter{
{
Key: "customer_id",
Operator: "=",
Value: "a-customer-id",
},
},
})
// the rest of your handlers code
}