Skip to content

Commit

Permalink
Change method name. SignUp -> CreateUser
Browse files Browse the repository at this point in the history
  • Loading branch information
gusah009 committed Jul 21, 2024
1 parent 9ab1142 commit 35895c7
Show file tree
Hide file tree
Showing 10 changed files with 687 additions and 435 deletions.
6 changes: 3 additions & 3 deletions admin/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,13 @@ func (c *Client) LogIn(
return response.Msg.Token, nil
}

// SignUp signs up a new user.
func (c *Client) SignUp(
// CreateUser creates a new user.
func (c *Client) CreateUser(
ctx context.Context,
username,
password string,
) (*types.User, error) {
response, err := c.client.SignUp(ctx, connect.NewRequest(&api.SignUpRequest{
response, err := c.client.CreateUser(ctx, connect.NewRequest(&api.CreateUserRequest{
Username: username,
Password: password,
}))
Expand Down
60 changes: 59 additions & 1 deletion api/docs/yorkie/v1/admin.openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,18 @@ paths:
$ref: '#/components/responses/connect.error'
tags:
- yorkie.v1.AdminService
/yorkie.v1.AdminService/CreateUser:
post:
description: ""
requestBody:
$ref: '#/components/requestBodies/yorkie.v1.AdminService.CreateUser.yorkie.v1.CreateUserRequest'
responses:
"200":
$ref: '#/components/responses/yorkie.v1.AdminService.CreateUser.yorkie.v1.CreateUserResponse'
default:
$ref: '#/components/responses/connect.error'
tags:
- yorkie.v1.AdminService
/yorkie.v1.AdminService/DeleteAccount:
post:
description: ""
Expand Down Expand Up @@ -168,7 +180,7 @@ paths:
- yorkie.v1.AdminService
/yorkie.v1.AdminService/SignUp:
post:
description: ""
description: 'Deprecated: will be replaced by CreateUser.'
requestBody:
$ref: '#/components/requestBodies/yorkie.v1.AdminService.SignUp.yorkie.v1.SignUpRequest'
responses:
Expand Down Expand Up @@ -210,6 +222,15 @@ components:
schema:
$ref: '#/components/schemas/yorkie.v1.CreateProjectRequest'
required: true
yorkie.v1.AdminService.CreateUser.yorkie.v1.CreateUserRequest:
content:
application/json:
schema:
$ref: '#/components/schemas/yorkie.v1.CreateUserRequest'
application/proto:
schema:
$ref: '#/components/schemas/yorkie.v1.CreateUserRequest'
required: true
yorkie.v1.AdminService.DeleteAccount.yorkie.v1.DeleteAccountRequest:
content:
application/json:
Expand Down Expand Up @@ -355,6 +376,15 @@ components:
schema:
$ref: '#/components/schemas/yorkie.v1.CreateProjectResponse'
description: ""
yorkie.v1.AdminService.CreateUser.yorkie.v1.CreateUserResponse:
content:
application/json:
schema:
$ref: '#/components/schemas/yorkie.v1.CreateUserResponse'
application/proto:
schema:
$ref: '#/components/schemas/yorkie.v1.CreateUserResponse'
description: ""
yorkie.v1.AdminService.DeleteAccount.yorkie.v1.DeleteAccountResponse:
content:
application/json:
Expand Down Expand Up @@ -720,6 +750,34 @@ components:
type: object
title: CreateProjectResponse
type: object
yorkie.v1.CreateUserRequest:
additionalProperties: false
description: ""
properties:
password:
additionalProperties: false
description: ""
title: password
type: string
username:
additionalProperties: false
description: ""
title: username
type: string
title: CreateUserRequest
type: object
yorkie.v1.CreateUserResponse:
additionalProperties: false
description: ""
properties:
user:
$ref: '#/components/schemas/yorkie.v1.User'
additionalProperties: false
description: ""
title: user
type: object
title: CreateUserResponse
type: object
yorkie.v1.DeleteAccountRequest:
additionalProperties: false
description: ""
Expand Down
Loading

0 comments on commit 35895c7

Please sign in to comment.