2323 status_code = status .HTTP_201_CREATED ,
2424 response_model = Envelope [ApiKeyGet ],
2525 # responses={
26- # status.HTTP_200_OK: {
27- # "description": "Authorization granted returning API key",
28- # "model": ApiKeyGet,
29- # },
3026 # status.HTTP_400_BAD_REQUEST: {
3127 # "description": "key name requested is invalid",
3228 # },
@@ -46,11 +42,8 @@ async def create_api_key(_body: ApiKeyCreate):
4642 "/auth/api-keys" ,
4743 operation_id = "list_display_names" ,
4844 response_model = Envelope [list [str ]],
45+ status_code = status .HTTP_200_OK ,
4946 # responses={
50- # status.HTTP_200_OK: {
51- # "description": "returns the display names of API keys",
52- # "model": list[str],
53- # },
5447 # status.HTTP_400_BAD_REQUEST: {
5548 # "description": "key name requested is invalid",
5649 # },
@@ -70,11 +63,8 @@ async def list_api_keys():
7063 "/auth/api-keys/{api_key_id}" ,
7164 operation_id = "get_api_key" ,
7265 response_model = Envelope [ApiKeyGet ],
66+ status_code = status .HTTP_200_OK ,
7367 # responses={
74- # status.HTTP_200_OK: {
75- # "description": "returns the api key or None",
76- # "model": ApiKeyGet | None,
77- # },
7868 # status.HTTP_400_BAD_REQUEST: {
7969 # "description": "key name requested is invalid",
8070 # },
@@ -95,9 +85,6 @@ async def get_api_key(_path: Annotated[ApiKeysPathParams, Depends()]):
9585 operation_id = "delete_api_key" ,
9686 status_code = status .HTTP_204_NO_CONTENT ,
9787 # responses={
98- # status.HTTP_204_NO_CONTENT: {
99- # "description": "api key successfully deleted",
100- # },
10188 # status.HTTP_401_UNAUTHORIZED: {
10289 # "description": "requires login to delete a key",
10390 # },
@@ -106,5 +93,5 @@ async def get_api_key(_path: Annotated[ApiKeysPathParams, Depends()]):
10693 # },
10794 # },
10895)
109- async def delete_api_key (_body : ApiKeyCreate ):
110- """deletes API key by name """
96+ async def delete_api_key (_path : Annotated [ ApiKeysPathParams , Depends ()] ):
97+ """deletes API key by ID """
0 commit comments