Skip to content

Commit bbcc90d

Browse files
committed
/me/device-tokens -> /me/access-tokens
1 parent 9ace306 commit bbcc90d

File tree

7 files changed

+22
-22
lines changed

7 files changed

+22
-22
lines changed

nexus/external-api/output/nexus_tags.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,8 @@ ping GET /v1/ping
289289

290290
API operations found with tag "tokens"
291291
OPERATION ID METHOD URL PATH
292-
current_user_device_token_delete DELETE /v1/me/device-tokens/{token_id}
293-
current_user_device_token_list GET /v1/me/device-tokens
292+
current_user_access_token_delete DELETE /v1/me/access-tokens/{token_id}
293+
current_user_access_token_list GET /v1/me/access-tokens
294294

295295
API operations found with tag "vpcs"
296296
OPERATION ID METHOD URL PATH

nexus/external-api/src/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3155,28 +3155,28 @@ pub trait NexusExternalApi {
31553155
path_params: Path<params::SshKeyPath>,
31563156
) -> Result<HttpResponseDeleted, HttpError>;
31573157

3158-
/// List device tokens
3158+
/// List access tokens
31593159
///
31603160
/// List device access tokens for the currently authenticated user.
31613161
#[endpoint {
31623162
method = GET,
3163-
path = "/v1/me/device-tokens",
3163+
path = "/v1/me/access-tokens",
31643164
tags = ["tokens"],
31653165
}]
3166-
async fn current_user_device_token_list(
3166+
async fn current_user_access_token_list(
31673167
rqctx: RequestContext<Self::Context>,
31683168
query_params: Query<PaginatedById>,
31693169
) -> Result<HttpResponseOk<ResultsPage<views::DeviceAccessToken>>, HttpError>;
31703170

3171-
/// Delete device token
3171+
/// Delete access token
31723172
///
31733173
/// Delete a device access token for the currently authenticated user.
31743174
#[endpoint {
31753175
method = DELETE,
3176-
path = "/v1/me/device-tokens/{token_id}",
3176+
path = "/v1/me/access-tokens/{token_id}",
31773177
tags = ["tokens"],
31783178
}]
3179-
async fn current_user_device_token_delete(
3179+
async fn current_user_access_token_delete(
31803180
rqctx: RequestContext<Self::Context>,
31813181
path_params: Path<params::TokenPath>,
31823182
) -> Result<HttpResponseDeleted, HttpError>;

nexus/src/external_api/http_entrypoints.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7068,7 +7068,7 @@ impl NexusExternalApi for NexusExternalApiImpl {
70687068
.await
70697069
}
70707070

7071-
async fn current_user_device_token_list(
7071+
async fn current_user_access_token_list(
70727072
rqctx: RequestContext<Self::Context>,
70737073
query_params: Query<PaginatedById>,
70747074
) -> Result<HttpResponseOk<ResultsPage<views::DeviceAccessToken>>, HttpError>
@@ -7099,7 +7099,7 @@ impl NexusExternalApi for NexusExternalApiImpl {
70997099
.await
71007100
}
71017101

7102-
async fn current_user_device_token_delete(
7102+
async fn current_user_access_token_delete(
71037103
rqctx: RequestContext<Self::Context>,
71047104
path_params: Path<params::TokenPath>,
71057105
) -> Result<HttpResponseDeleted, HttpError> {

nexus/tests/integration_tests/device_auth.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ async fn test_device_auth_flow(cptestctx: &ControlPlaneTestContext) {
208208
let token_id = tokens_unpriv_after[0].id;
209209

210210
// Priv user cannot delete unpriv's token through this endpoint by ID
211-
let token_url = format!("/v1/me/device-tokens/{}", token_id);
211+
let token_url = format!("/v1/me/access-tokens/{}", token_id);
212212
object_delete_error(testctx, &token_url, StatusCode::NOT_FOUND).await;
213213

214214
// Test deleting the token as the owner
@@ -434,7 +434,7 @@ async fn test_device_token_expiration(cptestctx: &ControlPlaneTestContext) {
434434
async fn get_tokens_priv(
435435
testctx: &ClientTestContext,
436436
) -> Vec<views::DeviceAccessToken> {
437-
NexusRequest::object_get(testctx, "/v1/me/device-tokens")
437+
NexusRequest::object_get(testctx, "/v1/me/access-tokens")
438438
.authn_as(AuthnMode::PrivilegedUser)
439439
.execute_and_parse_unwrap::<ResultsPage<views::DeviceAccessToken>>()
440440
.await
@@ -444,7 +444,7 @@ async fn get_tokens_priv(
444444
async fn get_tokens_unpriv(
445445
testctx: &ClientTestContext,
446446
) -> Vec<views::DeviceAccessToken> {
447-
NexusRequest::object_get(testctx, "/v1/me/device-tokens")
447+
NexusRequest::object_get(testctx, "/v1/me/access-tokens")
448448
.authn_as(AuthnMode::UnprivilegedUser)
449449
.execute_and_parse_unwrap::<ResultsPage<views::DeviceAccessToken>>()
450450
.await

nexus/tests/integration_tests/endpoints.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2599,7 +2599,7 @@ pub static VERIFY_ENDPOINTS: LazyLock<Vec<VerifyEndpoint>> =
25992599
},
26002600
/* Tokens */
26012601
VerifyEndpoint {
2602-
url: "/v1/me/device-tokens",
2602+
url: "/v1/me/access-tokens",
26032603
visibility: Visibility::Public,
26042604
unprivileged_access: UnprivilegedAccess::ReadOnly,
26052605
allowed_methods: vec![AllowedMethod::Get],
@@ -2610,7 +2610,7 @@ pub static VERIFY_ENDPOINTS: LazyLock<Vec<VerifyEndpoint>> =
26102610
// and opt out.
26112611

26122612
// VerifyEndpoint {
2613-
// url: "/v1/me/device-tokens/token-id",
2613+
// url: "/v1/me/access-tokens/token-id",
26142614
// visibility: Visibility::Public,
26152615
// unprivileged_access: UnprivilegedAccess::None,
26162616
// allowed_methods: vec![AllowedMethod::Delete],

nexus/tests/output/uncovered-authz-endpoints.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
API endpoints with no coverage in authz tests:
22
probe_delete (delete "/experimental/v1/probes/{probe}")
3-
current_user_device_token_delete (delete "/v1/me/device-tokens/{token_id}")
3+
current_user_access_token_delete (delete "/v1/me/access-tokens/{token_id}")
44
probe_list (get "/experimental/v1/probes")
55
probe_view (get "/experimental/v1/probes/{probe}")
66
support_bundle_download (get "/experimental/v1/system/support-bundles/{bundle_id}/download")

openapi/nexus.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5512,14 +5512,14 @@
55125512
}
55135513
}
55145514
},
5515-
"/v1/me/device-tokens": {
5515+
"/v1/me/access-tokens": {
55165516
"get": {
55175517
"tags": [
55185518
"tokens"
55195519
],
5520-
"summary": "List device tokens",
5520+
"summary": "List access tokens",
55215521
"description": "List device access tokens for the currently authenticated user.",
5522-
"operationId": "current_user_device_token_list",
5522+
"operationId": "current_user_access_token_list",
55235523
"parameters": [
55245524
{
55255525
"in": "query",
@@ -5572,14 +5572,14 @@
55725572
}
55735573
}
55745574
},
5575-
"/v1/me/device-tokens/{token_id}": {
5575+
"/v1/me/access-tokens/{token_id}": {
55765576
"delete": {
55775577
"tags": [
55785578
"tokens"
55795579
],
5580-
"summary": "Delete device token",
5580+
"summary": "Delete access token",
55815581
"description": "Delete a device access token for the currently authenticated user.",
5582-
"operationId": "current_user_device_token_delete",
5582+
"operationId": "current_user_access_token_delete",
55835583
"parameters": [
55845584
{
55855585
"in": "path",

0 commit comments

Comments
 (0)