Skip to content

Commit

Permalink
Merge branch 'main' into eng-1606-overhaul-emptyplaceholder
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelUnkey authored Jan 15, 2025
2 parents 152f95c + 0fc7d1c commit 62013ff
Show file tree
Hide file tree
Showing 30 changed files with 3,820 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,11 @@ export const UpdateKeyRemaining: React.FC<Props> = ({ apiKey }) => {
delete values.refill;
}
// make sure they aren't sent to the server if they are disabled.
if (values.refill?.interval !== "none" && !values.refill?.amount) {
if (
values.refill?.interval !== undefined &&
values.refill?.interval !== "none" &&
!values.refill?.amount
) {
form.setError("refill.amount", {
type: "manual",
message: "Please enter a value if interval is selected",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,14 @@ export const CreateKey = ({ apiId, keyAuthId, defaultBytes, defaultPrefix }: Pro
limitEnabled: false,
metaEnabled: false,
ratelimitEnabled: false,
limit: {
remaining: undefined,
refill: {
interval: "none",
amount: undefined,
refillDay: undefined,
},
},
},
});

Expand Down Expand Up @@ -111,12 +119,11 @@ export const CreateKey = ({ apiId, keyAuthId, defaultBytes, defaultPrefix }: Pro
}
const refill = values.limit?.refill;
if (refill?.interval === "daily") {
refill?.refillDay === undefined;
refill.refillDay = undefined;
}
if (refill?.interval === "monthly" && !refill.refillDay) {
refill.refillDay = 1;
}

await key.mutateAsync({
keyAuthId,
...values,
Expand Down Expand Up @@ -516,10 +523,7 @@ export const CreateKey = ({ apiId, keyAuthId, defaultBytes, defaultPrefix }: Pro
render={({ field }) => (
<FormItem className="">
<FormLabel>Refill Rate</FormLabel>
<Select
onValueChange={field.onChange}
value={field.value || "none"}
>
<Select onValueChange={field.onChange} value={field.value}>
<SelectTrigger>
<SelectValue />
</SelectTrigger>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export const formSchema = z.object({
.int()
.min(1)
.max(31)
.default(1),
.optional(),
})
.optional(),
})
Expand Down
71 changes: 71 additions & 0 deletions go/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
module github.com/unkeyed/unkey/go

go 1.23.4

require (
github.com/Southclaws/fault v0.8.1
github.com/axiomhq/axiom-go v0.21.1
github.com/btcsuite/btcutil v1.0.2
github.com/google/uuid v1.6.0
github.com/oapi-codegen/nullable v1.1.0
github.com/oapi-codegen/runtime v1.1.1
github.com/pb33f/libopenapi v0.16.5
github.com/pb33f/libopenapi-validator v0.1.0
github.com/rs/zerolog v1.33.0
github.com/segmentio/ksuid v1.0.4
github.com/stretchr/testify v1.10.0
github.com/unkeyed/unkey/apps/agent v0.0.0-20250104094322-474d5d220db9
)

require (
github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect
github.com/bahlo/generic-list-go v0.2.0 // indirect
github.com/buger/jsonparser v1.1.1 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/dprotaso/go-yit v0.0.0-20220510233725-9ba8df137936 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/getkin/kin-openapi v0.127.0 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/jsonpointer v0.21.0 // indirect
github.com/go-openapi/swag v0.23.0 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 // indirect
github.com/invopop/yaml v0.3.1 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/klauspost/compress v1.17.9 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
github.com/oapi-codegen/oapi-codegen/v2 v2.4.1 // indirect
github.com/onsi/gomega v1.27.6 // indirect
github.com/perimeterx/marshmallow v1.1.5 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 // indirect
github.com/speakeasy-api/openapi-overlay v0.9.0 // indirect
github.com/vmware-labs/yaml-jsonpath v0.3.2 // indirect
github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.55.0 // indirect
go.opentelemetry.io/otel v1.30.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.30.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.30.0 // indirect
go.opentelemetry.io/otel/metric v1.30.0 // indirect
go.opentelemetry.io/otel/sdk v1.30.0 // indirect
go.opentelemetry.io/otel/trace v1.30.0 // indirect
go.opentelemetry.io/proto/otlp v1.3.1 // indirect
golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e // indirect
golang.org/x/mod v0.21.0 // indirect
golang.org/x/net v0.29.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.25.0 // indirect
golang.org/x/text v0.18.0 // indirect
golang.org/x/tools v0.25.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect
google.golang.org/grpc v1.66.1 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit 62013ff

Please sign in to comment.