Skip to content

Commit

Permalink
feat: implement v1/auth/token
Browse files Browse the repository at this point in the history
  • Loading branch information
siloneco committed Jan 11, 2024
1 parent e0680f7 commit 428a8d2
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 0 deletions.
36 changes: 36 additions & 0 deletions openapi/api_definition.swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ info:
version: version not set
tags:
- name: DiscordCallbackService
- name: TokenService
- name: TagsService
consumes:
- application/json
Expand Down Expand Up @@ -36,6 +37,32 @@ paths:
type: string
tags:
- DiscordCallbackService
/v1/auth/token:
post:
operationId: TokenService_PostToken
responses:
"200":
description: A successful response.
schema:
$ref: '#/definitions/rpcPostTokenResponse'
"422":
description: Validation Error
schema: {}
examples:
application/json:
detail:
- loc:
- string
- 0
msg: string
type: string
parameters:
- name: refresh_token
in: query
required: false
type: string
tags:
- TokenService
/v1/tags:
get:
operationId: TagsService_GetTags
Expand Down Expand Up @@ -97,6 +124,15 @@ definitions:
items:
type: object
$ref: '#/definitions/tagsresourcesTag'
rpcPostTokenResponse:
type: object
properties:
expired_at:
type: string
refresh_token:
type: string
access_token:
type: string
tagsresourcesTag:
type: object
example:
Expand Down
13 changes: 13 additions & 0 deletions proto/schema/auth/token/rpc/token.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
syntax = "proto3";

package proto.schema.auth.token.rpc;

option go_package = "./";

message PostTokenRequest { string refresh_token = 1; }

message PostTokenResponse {
string expired_at = 1;
string refresh_token = 2;
string access_token = 3;
}
17 changes: 17 additions & 0 deletions proto/schema/auth/token/token.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
syntax = "proto3";

package proto.token;

import "proto/schema/auth/token/rpc/token.proto";
import "proto/third_party/google/api/annotations.proto";

option go_package = "./";

service TokenService {
rpc PostToken(proto.schema.auth.token.rpc.PostTokenRequest)
returns (proto.schema.auth.token.rpc.PostTokenResponse) {
option (google.api.http) = {
post : "/v1/auth/token"
};
};
}

0 comments on commit 428a8d2

Please sign in to comment.