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

API Key Expiration Updates #3442

Merged
merged 11 commits into from
Jan 3, 2025
Binary file modified astro/public/img/docs/apis/api-key-endpoint-permissions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified astro/public/img/docs/apis/create-tenant-api-key.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified astro/public/img/docs/create-api-key.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions astro/src/content/docs/apis/_apikey-get-response-body.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import JSON from 'src/components/JSON.astro';
#### Response Body

<APIBlock>
<APIField name="apiKey.expirationInstant" type="Long">
The expiration [instant](/docs/reference/data-types#instants) of this API key. Once an API key has expired, it will no longer be accepted for [API Authentication](/docs/apis/authentication).
</APIField>
<APIField name="apiKey.id" type="UUID">
The Id of the API key.
</APIField>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import EnterprisePlanBlurbApi from 'src/content/docs/_shared/_enterprise-plan-bl
#### Request Body

<APIBlock>
<APIField name="apiKey.expirationInstant" type="Long" optional since="1.55.0">
The expiration [instant](/docs/reference/data-types#instants) of this API key. Once an API key has expired, it will no longer be accepted for [API Authentication](/docs/apis/authentication).
</APIField>
<APIField name="apiKey.key" type="String" optional renderif={props.apikey_create_request}>
API key string. When you create an API key the key is defaulted to a secure random value but the API key is simply a string, so you may call it `super-secret-key` if you'd like. However a long and random value makes a good API key in that it is unique and difficult to guess.
</APIField>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import JSON from 'src/components/JSON.astro';
#### Response Body

<APIBlock>
<APIField name="apiKey.expirationInstant" type="Long">
The expiration [instant](/docs/reference/data-types#instants) of this API key. Once an API key has expired, it will no longer be accepted for [API Authentication](/docs/apis/authentication).
</APIField>
<APIField name="apiKey.id" type="UUID" renderif={props.apikey_create_response}>
The Id of the API key.
</APIField>
Expand Down
9 changes: 9 additions & 0 deletions astro/src/content/docs/apis/authentication.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import APIKeyCrossTenantNote from 'src/content/docs/apis/_api-key-cross-tenant-n
import Aside from 'src/components/Aside.astro';
import ClientSideApiKeys from 'src/content/docs/_shared/_client-side-api-keys.mdx';
import NewApiKey401 from 'src/content/docs/apis/_new-api-key-401.mdx';
import EnterprisePlanBlurb from 'src/content/docs/_shared/_enterprise-plan-blurb.astro';
import ScrollRef from 'src/components/ScrollRef.astro';
import TenantAuthentication from 'src/content/docs/apis/_tenant-authentication.mdx';
import Breadcrumb from 'src/components/Breadcrumb.astro';
Expand Down Expand Up @@ -208,6 +209,14 @@ Prior to version `1.26.0`, the FusionAuth administrative user interface was the

Any attempt to call the API Keys API with a non-manager key (`keyManager` set to `false`) will return a HTTP response status code `401`.
</APIField>
<APIField name="Access Control List">
The optional [IP Access Control List](/docs/apis/ip-acl) for restricting the usage of this API key by network address.

<EnterprisePlanBlurb />
</APIField>
<APIField name="Expiration">
The optional date and time at which this API key will expire and no longer be usable for API authentication.
</APIField>
</APIBlock>

<TenantAuthentication />
Expand Down
3 changes: 2 additions & 1 deletion astro/src/content/json/api-keys/get-response.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"apiKey": {
"expirationInstant": 872812800000,
"id": "b016fa93-e8bc-4b79-b39f-5d37966c0178",
"insertInstant": 1619119404194,
"ipAccessControlListId": "eae37b0e-950b-4e92-abcc-d0b310326f66",
Expand Down Expand Up @@ -38,4 +39,4 @@
},
"tenantId": "94f751c5-4883-4684-a817-6b106778edec"
}
}
}
3 changes: 2 additions & 1 deletion astro/src/content/json/api-keys/post-request-body.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"apiKey": {
"expirationInstant": 872812800000,
"key": "super-secret-key",
"ipAccessControlListId": "eae37b0e-950b-4e92-abcc-d0b310326f66",
"metaData": {
Expand All @@ -20,4 +21,4 @@
},
"tenantId": "94f751c5-4883-4684-a817-6b106778edec"
}
}
}
3 changes: 2 additions & 1 deletion astro/src/content/json/api-keys/post-response-body.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"apiKey": {
"expirationInstant": 872812800000,
"id": "de36ce0f-70db-4d73-b0b2-9f82c1572761",
"insertInstant": 1619726194060,
"ipAccessControlListId": "eae37b0e-950b-4e92-abcc-d0b310326f66",
Expand All @@ -24,4 +25,4 @@
},
"tenantId": "94f751c5-4883-4684-a817-6b106778edec"
}
}
}
3 changes: 2 additions & 1 deletion astro/src/content/json/api-keys/put-request-body.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"apiKey": {
"expirationInstant": 1878422400000,
"ipAccessControlListId": "eae37b0e-950b-4e92-abcc-d0b310326f66",
"metaData": {
"attributes": {
Expand All @@ -18,4 +19,4 @@
}
}
}
}
}
3 changes: 2 additions & 1 deletion astro/src/content/json/api-keys/put-response-body.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"apiKey": {
"expirationInstant": 1878422400000,
"id": "b016fa93-e8bc-4b79-b39f-5d37966c0178",
"insertInstant": 1619119404194,
"ipAccessControlListId": "eae37b0e-950b-4e92-abcc-d0b310326f66",
Expand All @@ -24,4 +25,4 @@
},
"tenantId": "94f751c5-4883-4684-a817-6b106778edec"
}
}
}