- Fix race condition for concurrent requests using the
protected
decorator.
- The
Client
can now be used as an async context manager which starts and closes the client automatically.
- The
InvalidKeyHandlerT
andExcHandlerT
types no longer includeOptional
, and instead are wrapped inOptional
in the function signature.
- Fix invalid docs link.
- Add
protected
decorator for verifying keys easily in web frameworks.
Client
constructor parameterapi_key
is now optional.
- Inner return type of
KeyService.update_remaining
is now correctlyOptional
.
- Add
Refill
,RefillInterval
, andUpdateOp
models/enums. - Add
id
property ontoApiKeyVerification
. - Add
refill
property ontoApiKeyMeta
andApiKeyVerification
. - Add serialization methods for new properties and models.
- Add support for
refill
when creating and updating a key. - Add
update_remaining
method toKeyService
and correspondingRoute
.
verify_key
now requires anapi_id
parameter.list_keys
no longer accepts theoffset
parameter.
- Add
Conflict
variant toErrorCode
. - Add
get_key
method toKeyService
. - Add
cursor
parameter tolist_keys
.
- Fix invalid default used when ratelimit was not passed in
create_key
.
- Refactor internal routes to use new API endpoints.
- Add
NotUnique
andInvalidKeyType
variants toErrorCode
.
- Rename
UsageExceeded
error code toKeyUsageExceeded
.
- Add
RatelimitState
model. - Add
ratelimit
andexpires
fields toApiKeyVerification
.
UNDEFINED
is now guaranteed to be a singleton, preventingid(obj)
mismatches.
Client.start()
now correctly initializes a new client session if called after closing the client previously.
- Tests :).
- Add
UNDEFINED
,UndefinedOr
, andUndefinedNoneOr
types. - Add
update_key
method to key service. - Add
name
parameter to thecreate_key
method.
- Refactor existing methods to use the new
UNDEFINED
type.
- Remove debug print statement in
list_keys
.
- Add
ErrorCode
enum. - Add
remaining
parameter tocreate_key
. - Add
remaining
field toApiKeyVerification
andApiKeyMeta
models. - Add
code
field toApiKeyVerification
model. - Add
code
field toHttpResponse
model.
- Update status code for
revoke_key
to 200 OK.
- Add
Client
,KeyService
andApiService
. - Add
Serializer
, and other necessary base services. - Add relevant models.
- Add support for all publicly documented endpoints:
- Get API
- List Keys
- Create Key
- Verify Key
- Revoke Key
- Initial release!