Skip to content

Commit 0ab6663

Browse files
committed
chore: add summary and descriptions for OAuth routes
1 parent 0808ccd commit 0ab6663

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Intersect.Server/Web/RestApi/Routes/OAuthController.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
using Intersect.Server.Web.Http;
1313
using Intersect.Server.Web.RestApi.Types;
1414
using Microsoft.AspNetCore.Authorization;
15+
using Microsoft.AspNetCore.Http;
1516
using Microsoft.Extensions.Options;
1617
using Microsoft.IdentityModel.Tokens;
1718
using Newtonsoft.Json;
@@ -197,6 +198,8 @@ public class TokenRequestRefreshTokenGrant : TokenRequest
197198
}
198199

199200
[HttpPost("token")]
201+
[EndpointSummary("Request an Access Token")]
202+
[EndpointDescription("Request an access token (and a refresh token) with a `password` grant, or a `refresh_token` grant.")]
200203
[Consumes(typeof(TokenRequest), ContentTypes.Json)]
201204
[ProducesResponseType<TokenResponse>((int)HttpStatusCode.OK, ContentTypes.Json)]
202205
[ProducesResponseType<StatusMessageResponseBody>((int)HttpStatusCode.BadRequest, ContentTypes.Json)]
@@ -300,7 +303,10 @@ private async Task<IActionResult> RequestTokenFrom(TokenRequestRefreshTokenGrant
300303
};
301304
}
302305

306+
[Authorize]
303307
[HttpDelete("tokens/{tokenId:guid}")]
308+
[EndpointSummary("Delete a Refresh Token by ID")]
309+
[EndpointDescription("Delete the Refresh Token specified by the tokenId parameter.")]
304310
[ProducesResponseType<UsernameAndTokenResponse>((int)HttpStatusCode.OK, ContentTypes.Json)]
305311
[ProducesResponseType<StatusMessageResponseBody>((int)HttpStatusCode.Forbidden, ContentTypes.Json)]
306312
[ProducesResponseType<StatusMessageResponseBody>((int)HttpStatusCode.InternalServerError, ContentTypes.Json)]
@@ -349,6 +355,8 @@ public async Task<IActionResult> DeleteTokenById(Guid tokenId)
349355

350356
[Authorize]
351357
[HttpDelete("tokens/{username}")]
358+
[EndpointSummary("Delete all Refresh Tokens for a User")]
359+
[EndpointDescription("Delete all refresh tokens for the user specified by the username parameter.")]
352360
[ProducesResponseType<UsernameAndTokenResponse>((int)HttpStatusCode.OK, ContentTypes.Json)]
353361
[ProducesResponseType<StatusMessageResponseBody>((int)HttpStatusCode.Forbidden, ContentTypes.Json)]
354362
[ProducesResponseType<StatusMessageResponseBody>((int)HttpStatusCode.Gone, ContentTypes.Json)]
@@ -408,7 +416,10 @@ public async Task<IActionResult> DeleteTokensForUsername(string username, Cancel
408416
return InternalServerError("Failed to delete token");
409417
}
410418

419+
[Authorize]
411420
[HttpDelete("tokens/{username}/{tokenId:guid}")]
421+
[EndpointSummary("Delete a Refresh Token by ID for a User")]
422+
[EndpointDescription("Delete the Refresh Token specified by the tokenId parameter for the user specified by the username parameter.")]
412423
[ProducesResponseType<UsernameAndTokenResponse>((int)HttpStatusCode.OK, ContentTypes.Json)]
413424
[ProducesResponseType<StatusMessageResponseBody>((int)HttpStatusCode.Forbidden, ContentTypes.Json)]
414425
[ProducesResponseType<StatusMessageResponseBody>((int)HttpStatusCode.InternalServerError, ContentTypes.Json)]

0 commit comments

Comments
 (0)