diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 42d8c20..34b042b 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,22 +1,23 @@ lockVersion: 2.0.0 id: 4fc4737a-135f-4840-8e6d-42a2b2a2884b management: - docChecksum: 957bade817085c900e9e156fe28f22de + docChecksum: f6d66cb825eb0c9feff79d4f839323a0 docVersion: 1.0.0 - speakeasyVersion: 1.424.0 - generationVersion: 2.445.1 - releaseVersion: 0.10.0 - configChecksum: f05f5642b3717c2fef64128e2da1d736 + speakeasyVersion: 1.440.1 + generationVersion: 2.460.1 + releaseVersion: 0.11.0 + configChecksum: a062b6a46d3010813d5b8551dd3182c1 repoURL: https://github.com/unkeyed/unkey-go.git installationURL: https://github.com/unkeyed/unkey-go features: go: additionalDependencies: 0.1.0 constsAndDefaults: 0.1.6 - core: 3.5.14 + core: 3.5.16 defaultEnabledRetries: 0.2.0 deprecations: 2.81.1 - envVarSecurityUsage: 0.3.1 + envVarSecurityUsage: 0.3.2 + examples: 2.81.3 globalSecurity: 2.82.10 globalSecurityCallbacks: 0.1.0 globalSecurityFlattening: 0.1.0 @@ -29,7 +30,7 @@ features: retries: 2.83.0 sdkHooks: 0.1.0 tests: 0.6.0 - unions: 2.85.9 + unions: 2.85.10 generatedFiles: - .gitattributes - /models/components/httpmetadata.go diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 4c5f0c2..6c43b6d 100755 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -11,11 +11,13 @@ generation: requestResponseComponentNamesFeb2024: true auth: oAuth2ClientCredentialsEnabled: true + oAuth2PasswordEnabled: false go: - version: 0.10.0 + version: 0.11.0 additionalDependencies: {} allowUnknownFieldsInWeakUnions: false clientServerStatusCodesAsErrors: true + defaultErrorName: SDKError flattenGlobalSecurity: true imports: option: openapi diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 7fb0de2..1c53b97 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,20 +1,20 @@ -speakeasyVersion: 1.424.0 +speakeasyVersion: 1.440.1 sources: openapi.json: sourceNamespace: openapi-json - sourceRevisionDigest: sha256:5b4d353e01dd74e0ac9a8b521d71e5c97ffe1a654d77d3d8036b2e783bd08612 - sourceBlobDigest: sha256:f03ba20fc32a90e85dacb81cd6f3b52c07e2a8a3dabda2f7186120b67c4d94ef + sourceRevisionDigest: sha256:4d52858109e0215517934d01c9c386556f9bbefcb11a5fe88c77f3abb02c7d97 + sourceBlobDigest: sha256:fe67a0253c7087a97b8ff4e6f4ab458d5fef7a8cd424e3f60d6dadd066623f85 tags: - latest - - main + - speakeasy-sdk-regen-1731025759 targets: go: source: openapi.json sourceNamespace: openapi-json - sourceRevisionDigest: sha256:5b4d353e01dd74e0ac9a8b521d71e5c97ffe1a654d77d3d8036b2e783bd08612 - sourceBlobDigest: sha256:f03ba20fc32a90e85dacb81cd6f3b52c07e2a8a3dabda2f7186120b67c4d94ef + sourceRevisionDigest: sha256:4d52858109e0215517934d01c9c386556f9bbefcb11a5fe88c77f3abb02c7d97 + sourceBlobDigest: sha256:fe67a0253c7087a97b8ff4e6f4ab458d5fef7a8cd424e3f60d6dadd066623f85 codeSamplesNamespace: openapi-json-code-samples - codeSamplesRevisionDigest: sha256:4df0c16b687b1fbf319e382a23a0398699310d4173f21f3a4dfec5f6f7abb2e9 + codeSamplesRevisionDigest: sha256:6a0a77ae2cac2ced67b5eed9f1f63d1b40a8250608aa00a3ba56c5976d9cc0a9 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index a164296..1e96bbb 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ import ( func main() { s := unkeygo.New( - unkeygo.WithSecurity(""), + unkeygo.WithSecurity("UNKEY_ROOT_KEY"), ) ctx := context.Background() @@ -144,16 +144,16 @@ By Default, an API error will return `sdkerrors.SDKError`. When custom error res For example, the `V1Liveness` function may return the following errors: -| Error Type | Status Code | Content Type | -| -------------------------------- | -------------------------------- | -------------------------------- | -| sdkerrors.ErrBadRequest | 400 | application/json | -| sdkerrors.ErrUnauthorized | 401 | application/json | -| sdkerrors.ErrForbidden | 403 | application/json | -| sdkerrors.ErrNotFound | 404 | application/json | -| sdkerrors.ErrConflict | 409 | application/json | -| sdkerrors.ErrTooManyRequests | 429 | application/json | -| sdkerrors.ErrInternalServerError | 500 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| -------------------------------- | ----------- | ---------------- | +| sdkerrors.ErrBadRequest | 400 | application/json | +| sdkerrors.ErrUnauthorized | 401 | application/json | +| sdkerrors.ErrForbidden | 403 | application/json | +| sdkerrors.ErrNotFound | 404 | application/json | +| sdkerrors.ErrConflict | 409 | application/json | +| sdkerrors.ErrTooManyRequests | 429 | application/json | +| sdkerrors.ErrInternalServerError | 500 | application/json | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | ### Example @@ -170,7 +170,7 @@ import ( func main() { s := unkeygo.New( - unkeygo.WithSecurity(""), + unkeygo.WithSecurity("UNKEY_ROOT_KEY"), ) ctx := context.Background() @@ -233,47 +233,9 @@ func main() { ## Server Selection -### Select Server by Index - -You can override the default server globally using the `WithServerIndex` option when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers: - -| # | Server | Variables | -| - | ------ | --------- | -| 0 | `https://api.unkey.dev` | None | - -#### Example - -```go -package main - -import ( - "context" - unkeygo "github.com/unkeyed/unkey-go" - "log" -) - -func main() { - s := unkeygo.New( - unkeygo.WithServerIndex(0), - unkeygo.WithSecurity(""), - ) - - ctx := context.Background() - res, err := s.Liveness.V1Liveness(ctx) - if err != nil { - log.Fatal(err) - } - if res.Object != nil { - // handle response - } -} - -``` - - ### Override Server URL Per-Client -The default server can also be overridden globally using the `WithServerURL` option when initializing the SDK client instance. For example: +The default server can also be overridden globally using the `WithServerURL(serverURL string)` option when initializing the SDK client instance. For example: ```go package main @@ -286,7 +248,7 @@ import ( func main() { s := unkeygo.New( unkeygo.WithServerURL("https://api.unkey.dev"), - unkeygo.WithSecurity(""), + unkeygo.WithSecurity("UNKEY_ROOT_KEY"), ) ctx := context.Background() @@ -338,9 +300,9 @@ This can be a convenient way to configure timeouts, cookies, proxies, custom hea This SDK supports the following security scheme globally: -| Name | Type | Scheme | -| ------------ | ------------ | ------------ | -| `BearerAuth` | http | HTTP Bearer | +| Name | Type | Scheme | +| ------------ | ---- | ----------- | +| `BearerAuth` | http | HTTP Bearer | You can configure it using the `WithSecurity` option when initializing the SDK client instance. For example: ```go @@ -354,7 +316,7 @@ import ( func main() { s := unkeygo.New( - unkeygo.WithSecurity(""), + unkeygo.WithSecurity("UNKEY_ROOT_KEY"), ) ctx := context.Background() @@ -389,7 +351,7 @@ import ( func main() { s := unkeygo.New( - unkeygo.WithSecurity(""), + unkeygo.WithSecurity("UNKEY_ROOT_KEY"), ) ctx := context.Background() @@ -438,7 +400,7 @@ func main() { }, RetryConnectionErrors: false, }), - unkeygo.WithSecurity(""), + unkeygo.WithSecurity("UNKEY_ROOT_KEY"), ) ctx := context.Background() @@ -474,7 +436,7 @@ import ( func main() { s := unkeygo.New( - unkeygo.WithSecurity(""), + unkeygo.WithSecurity("UNKEY_ROOT_KEY"), ) ctx := context.Background() diff --git a/RELEASES.md b/RELEASES.md index d5ee4f2..5215246 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -268,4 +268,14 @@ Based on: ### Generated - [go v0.10.0] . ### Releases -- [Go v0.10.0] https://github.com/unkeyed/unkey-go/releases/tag/v0.10.0 - . \ No newline at end of file +- [Go v0.10.0] https://github.com/unkeyed/unkey-go/releases/tag/v0.10.0 - . + +## 2024-11-17 00:33:52 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.440.1 (2.460.1) https://github.com/speakeasy-api/speakeasy +### Generated +- [go v0.11.0] . +### Releases +- [Go v0.11.0] https://github.com/unkeyed/unkey-go/releases/tag/v0.11.0 - . \ No newline at end of file diff --git a/USAGE.md b/USAGE.md index 55e4a87..a702d76 100644 --- a/USAGE.md +++ b/USAGE.md @@ -10,7 +10,7 @@ import ( func main() { s := unkeygo.New( - unkeygo.WithSecurity(""), + unkeygo.WithSecurity("UNKEY_ROOT_KEY"), ) ctx := context.Background() diff --git a/docs/models/components/security.md b/docs/models/components/security.md index 45c85dd..ba39d3b 100644 --- a/docs/models/components/security.md +++ b/docs/models/components/security.md @@ -3,6 +3,6 @@ ## Fields -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `BearerAuth` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `BearerAuth` | *string* | :heavy_check_mark: | N/A | UNKEY_ROOT_KEY | \ No newline at end of file diff --git a/docs/models/operations/createkeyrequestbody.md b/docs/models/operations/createkeyrequestbody.md index 547ba6f..807bbe4 100644 --- a/docs/models/operations/createkeyrequestbody.md +++ b/docs/models/operations/createkeyrequestbody.md @@ -19,5 +19,5 @@ | `Refill` | [*operations.Refill](../../models/operations/refill.md) | :heavy_minus_sign: | Unkey enables you to refill verifications for each key at regular intervals. | {
"interval": "monthly",
"amount": 100,
"refillDay": 15
} | | `Ratelimit` | [*operations.Ratelimit](../../models/operations/ratelimit.md) | :heavy_minus_sign: | Unkey comes with per-key fixed-window ratelimiting out of the box. | {
"type": "fast",
"limit": 10,
"duration": 60000
} | | `Enabled` | **bool* | :heavy_minus_sign: | Sets if key is enabled or disabled. Disabled keys are not valid. | false | -| `Recoverable` | **bool* | :heavy_minus_sign: | You may want to show keys again later. While we do not recommend this, we leave this option open for you.

In addition to storing the key's hash, recoverable keys are stored in an encrypted vault, allowing you to retrieve and display the plaintext later.

https://www.unkey.com/docs/security/recovering-keys for more information. | | +| `Recoverable` | **bool* | :heavy_minus_sign: | You may want to show keys again later. While we do not recommend this, we leave this option open for you.

In addition to storing the key's hash, recoverable keys are stored in an encrypted vault, allowing you to retrieve and display the plaintext later.

[https://www.unkey.com/docs/security/recovering-keys](https://www.unkey.com/docs/security/recovering-keys) for more information. | | | `Environment` | **string* | :heavy_minus_sign: | Environments allow you to divide your keyspace.

Some applications like Stripe, Clerk, WorkOS and others have a concept of "live" and "test" keys to
give the developer a way to develop their own application without the risk of modifying real world
resources.

When you set an environment, we will return it back to you when validating the key, so you can
handle it correctly.
| | \ No newline at end of file diff --git a/docs/sdks/apis/README.md b/docs/sdks/apis/README.md index a1f62a2..b8d2cad 100644 --- a/docs/sdks/apis/README.md +++ b/docs/sdks/apis/README.md @@ -27,7 +27,7 @@ import( func main() { s := unkeygo.New( - unkeygo.WithSecurity(""), + unkeygo.WithSecurity("UNKEY_ROOT_KEY"), ) ctx := context.Background() @@ -84,7 +84,7 @@ import( func main() { s := unkeygo.New( - unkeygo.WithSecurity(""), + unkeygo.WithSecurity("UNKEY_ROOT_KEY"), ) ctx := context.Background() @@ -141,7 +141,7 @@ import( func main() { s := unkeygo.New( - unkeygo.WithSecurity(""), + unkeygo.WithSecurity("UNKEY_ROOT_KEY"), ) ctx := context.Background() @@ -199,7 +199,7 @@ import( func main() { s := unkeygo.New( - unkeygo.WithSecurity(""), + unkeygo.WithSecurity("UNKEY_ROOT_KEY"), ) ctx := context.Background() @@ -256,7 +256,7 @@ import( func main() { s := unkeygo.New( - unkeygo.WithSecurity(""), + unkeygo.WithSecurity("UNKEY_ROOT_KEY"), ) ctx := context.Background() diff --git a/docs/sdks/identities/README.md b/docs/sdks/identities/README.md index e35f8bc..378a0ac 100644 --- a/docs/sdks/identities/README.md +++ b/docs/sdks/identities/README.md @@ -27,7 +27,7 @@ import( func main() { s := unkeygo.New( - unkeygo.WithSecurity(""), + unkeygo.WithSecurity("UNKEY_ROOT_KEY"), ) ctx := context.Background() @@ -96,7 +96,7 @@ import( func main() { s := unkeygo.New( - unkeygo.WithSecurity(""), + unkeygo.WithSecurity("UNKEY_ROOT_KEY"), ) ctx := context.Background() @@ -154,7 +154,7 @@ import( func main() { s := unkeygo.New( - unkeygo.WithSecurity(""), + unkeygo.WithSecurity("UNKEY_ROOT_KEY"), ) ctx := context.Background() @@ -224,7 +224,7 @@ import( func main() { s := unkeygo.New( - unkeygo.WithSecurity(""), + unkeygo.WithSecurity("UNKEY_ROOT_KEY"), ) ctx := context.Background() @@ -299,7 +299,7 @@ import( func main() { s := unkeygo.New( - unkeygo.WithSecurity(""), + unkeygo.WithSecurity("UNKEY_ROOT_KEY"), ) ctx := context.Background() diff --git a/docs/sdks/keys/README.md b/docs/sdks/keys/README.md index 81a4f28..b14395c 100644 --- a/docs/sdks/keys/README.md +++ b/docs/sdks/keys/README.md @@ -36,7 +36,7 @@ import( func main() { s := unkeygo.New( - unkeygo.WithSecurity(""), + unkeygo.WithSecurity("UNKEY_ROOT_KEY"), ) ctx := context.Background() @@ -93,7 +93,7 @@ import( func main() { s := unkeygo.New( - unkeygo.WithSecurity(""), + unkeygo.WithSecurity("UNKEY_ROOT_KEY"), ) ctx := context.Background() @@ -150,7 +150,7 @@ import( func main() { s := unkeygo.New( - unkeygo.WithSecurity(""), + unkeygo.WithSecurity("UNKEY_ROOT_KEY"), ) ctx := context.Background() @@ -207,7 +207,7 @@ import( func main() { s := unkeygo.New( - unkeygo.WithSecurity(""), + unkeygo.WithSecurity("UNKEY_ROOT_KEY"), ) ctx := context.Background() @@ -291,7 +291,7 @@ import( func main() { s := unkeygo.New( - unkeygo.WithSecurity(""), + unkeygo.WithSecurity("UNKEY_ROOT_KEY"), ) ctx := context.Background() @@ -361,7 +361,7 @@ import( func main() { s := unkeygo.New( - unkeygo.WithSecurity(""), + unkeygo.WithSecurity("UNKEY_ROOT_KEY"), ) ctx := context.Background() @@ -464,7 +464,7 @@ import( func main() { s := unkeygo.New( - unkeygo.WithSecurity(""), + unkeygo.WithSecurity("UNKEY_ROOT_KEY"), ) ctx := context.Background() @@ -523,7 +523,7 @@ import( func main() { s := unkeygo.New( - unkeygo.WithSecurity(""), + unkeygo.WithSecurity("UNKEY_ROOT_KEY"), ) ctx := context.Background() @@ -584,7 +584,7 @@ import( func main() { s := unkeygo.New( - unkeygo.WithSecurity(""), + unkeygo.WithSecurity("UNKEY_ROOT_KEY"), ) ctx := context.Background() @@ -644,7 +644,7 @@ import( func main() { s := unkeygo.New( - unkeygo.WithSecurity(""), + unkeygo.WithSecurity("UNKEY_ROOT_KEY"), ) ctx := context.Background() @@ -709,7 +709,7 @@ import( func main() { s := unkeygo.New( - unkeygo.WithSecurity(""), + unkeygo.WithSecurity("UNKEY_ROOT_KEY"), ) ctx := context.Background() @@ -778,7 +778,7 @@ import( func main() { s := unkeygo.New( - unkeygo.WithSecurity(""), + unkeygo.WithSecurity("UNKEY_ROOT_KEY"), ) ctx := context.Background() @@ -847,7 +847,7 @@ import( func main() { s := unkeygo.New( - unkeygo.WithSecurity(""), + unkeygo.WithSecurity("UNKEY_ROOT_KEY"), ) ctx := context.Background() @@ -912,7 +912,7 @@ import( func main() { s := unkeygo.New( - unkeygo.WithSecurity(""), + unkeygo.WithSecurity("UNKEY_ROOT_KEY"), ) ctx := context.Background() diff --git a/docs/sdks/liveness/README.md b/docs/sdks/liveness/README.md index 3761cee..5660e95 100644 --- a/docs/sdks/liveness/README.md +++ b/docs/sdks/liveness/README.md @@ -22,7 +22,7 @@ import( func main() { s := unkeygo.New( - unkeygo.WithSecurity(""), + unkeygo.WithSecurity("UNKEY_ROOT_KEY"), ) ctx := context.Background() diff --git a/docs/sdks/migrations/README.md b/docs/sdks/migrations/README.md index 693090e..d096423 100644 --- a/docs/sdks/migrations/README.md +++ b/docs/sdks/migrations/README.md @@ -24,7 +24,7 @@ import( func main() { s := unkeygo.New( - unkeygo.WithSecurity(""), + unkeygo.WithSecurity("UNKEY_ROOT_KEY"), ) ctx := context.Background() @@ -111,7 +111,7 @@ import( func main() { s := unkeygo.New( - unkeygo.WithSecurity(""), + unkeygo.WithSecurity("UNKEY_ROOT_KEY"), ) ctx := context.Background() diff --git a/docs/sdks/permissions/README.md b/docs/sdks/permissions/README.md index c97b230..eb77bcb 100644 --- a/docs/sdks/permissions/README.md +++ b/docs/sdks/permissions/README.md @@ -30,7 +30,7 @@ import( func main() { s := unkeygo.New( - unkeygo.WithSecurity(""), + unkeygo.WithSecurity("UNKEY_ROOT_KEY"), ) ctx := context.Background() @@ -88,7 +88,7 @@ import( func main() { s := unkeygo.New( - unkeygo.WithSecurity(""), + unkeygo.WithSecurity("UNKEY_ROOT_KEY"), ) ctx := context.Background() @@ -145,7 +145,7 @@ import( func main() { s := unkeygo.New( - unkeygo.WithSecurity(""), + unkeygo.WithSecurity("UNKEY_ROOT_KEY"), ) ctx := context.Background() @@ -201,7 +201,7 @@ import( func main() { s := unkeygo.New( - unkeygo.WithSecurity(""), + unkeygo.WithSecurity("UNKEY_ROOT_KEY"), ) ctx := context.Background() @@ -255,7 +255,7 @@ import( func main() { s := unkeygo.New( - unkeygo.WithSecurity(""), + unkeygo.WithSecurity("UNKEY_ROOT_KEY"), ) ctx := context.Background() @@ -313,7 +313,7 @@ import( func main() { s := unkeygo.New( - unkeygo.WithSecurity(""), + unkeygo.WithSecurity("UNKEY_ROOT_KEY"), ) ctx := context.Background() @@ -370,7 +370,7 @@ import( func main() { s := unkeygo.New( - unkeygo.WithSecurity(""), + unkeygo.WithSecurity("UNKEY_ROOT_KEY"), ) ctx := context.Background() @@ -426,7 +426,7 @@ import( func main() { s := unkeygo.New( - unkeygo.WithSecurity(""), + unkeygo.WithSecurity("UNKEY_ROOT_KEY"), ) ctx := context.Background() diff --git a/docs/sdks/ratelimits/README.md b/docs/sdks/ratelimits/README.md index 63a40bc..b5d1dbb 100644 --- a/docs/sdks/ratelimits/README.md +++ b/docs/sdks/ratelimits/README.md @@ -23,7 +23,7 @@ import( func main() { s := unkeygo.New( - unkeygo.WithSecurity(""), + unkeygo.WithSecurity("UNKEY_ROOT_KEY"), ) ctx := context.Background() diff --git a/models/operations/createkey.go b/models/operations/createkey.go index 08ddefa..2c412d9 100644 --- a/models/operations/createkey.go +++ b/models/operations/createkey.go @@ -215,7 +215,7 @@ type CreateKeyRequestBody struct { // // In addition to storing the key's hash, recoverable keys are stored in an encrypted vault, allowing you to retrieve and display the plaintext later. // - // https://www.unkey.com/docs/security/recovering-keys for more information. + // [https://www.unkey.com/docs/security/recovering-keys](https://www.unkey.com/docs/security/recovering-keys) for more information. Recoverable *bool `default:"false" json:"recoverable"` // Environments allow you to divide your keyspace. // diff --git a/unkey.go b/unkey.go index bee8ff4..7915c05 100644 --- a/unkey.go +++ b/unkey.go @@ -154,9 +154,9 @@ func New(opts ...SDKOption) *Unkey { sdkConfiguration: sdkConfiguration{ Language: "go", OpenAPIDocVersion: "1.0.0", - SDKVersion: "0.10.0", - GenVersion: "2.445.1", - UserAgent: "speakeasy-sdk/go 0.10.0 2.445.1 1.0.0 github.com/unkeyed/unkey-go", + SDKVersion: "0.11.0", + GenVersion: "2.460.1", + UserAgent: "speakeasy-sdk/go 0.11.0 2.460.1 1.0.0 github.com/unkeyed/unkey-go", Hooks: hooks.New(), }, }