Skip to content

cccp-education/api

Repository files navigation

kotlin-springboot

springboot codebase

stack:
  • webflux

  • r2dbc spring-data h2

  • rest api

  • spring security jwt

  • coroutines

  • Http problem details RFC7807

  • junit5

  • gradle

  • gradle-kotlin-dsl

  • google-jib

  • google-appengine

  • mailSlurp-api

  • gmail-api

  • task scheduling

  • cli: command line interface

  • github-action(todo)

features:
  • Signup account

  • Password reset and update

  • Account settings

  • Users management

Running

to test the app

Open terminal and run : ./gradlew check

to run the app

Open terminal and run : ./gradlew bootRun

to run the cli

Open terminal and run : ./gradlew cli

REST-API

user-resource: /api/admin/users

GET /api/admin/users

Parameters

Name

Description

page
integer
(query)

Zero-based page index (0..N)

size
integer
(query)

The size of the page to be returned

sort
array[string]
(query)

Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.

Responses

Code

Description

200

OK
Media type: */*
Controls Accept header.
Schema: AdminUserDTO

PUT /api/admin/users

Parameters

no parameters

Request body *required must contain user object

Responses

Code

Description

200

OK
Media type: */*
Controls Accept header.
Schema: AdminUserDTO

POST /api/admin/users

Parameters

no parameters

Request body required containing user object

Responses

Code

Description

200

OK
Media type: */*
Controls Accept header.
Schema: User

GET /api/admin/users/{login}

Parameters

Name

Description

login *required
string
(path)

login

Responses

Code

Description

200

OK
Media type: */*
Controls Accept header.
Schema: AdminUserDTO

DELETE /api/admin/users/{login}

Parameters

Name

Description

login *required
string
(path)

login

Responses

Code

Description

200

OK

account-resource

POST /api/register

Parameters

no parameters

Request body *required must contain ManagedUserVM object

Responses

Code

Description

201

CREATED

GET /api/authenticate

Parameters

no parameters

Responses

Code

Description

200

OK
Media type: */*
Controls Accept header.
Schema: string
current role

GET /api/account

Parameters

no parameters

Responses

Code

Description

200

OK
Media type: */*
Controls Accept header.
Schema: AdminUserDTO

POST /api/account

Parameters

no parameters

Request body *required must contain ManagedUserVM object

Responses

Code

Description

200

OK

POST /api/account/reset-password/init

Parameters

no parameters

Request body *required must contain email string

Responses

Code

Description

200

OK

POST /api/account/reset-password/finish

Parameters

no parameters

Request body *required must contain PasswordChangeDTO object

Responses

Code

Description

200

OK

POST /api/account/reset-password/finish

Parameters

no parameters

Request body *required must contain KeyAndPasswordVM object

Responses

Code

Description

200

OK

POST /api/account/change-password

Parameters

no parameters

Request body *required must contain PasswordChangeDTO object

Responses

Code

Description

200

OK

GET /api/activate

Parameters

Name

Description

key *required
string
(query)

activation key

user-jwt-controller: /api/authenticate

POST /api/authenticate

Parameters

no parameters

Request body *required must contain LoginVM object

Responses

Code

Description

200

OK
Media type: */*
Controls Accept header.
Schema: JWTToken

public-user-resource

GET /api/users

Parameters

Name

Description

page
integer
(query)

Zero-based page index (0..N)

size
integer
(query)

The size of the page to be returned

sort
array[string]
(query)

Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.

Responses

Code

Description

200

OK
Media type: */*
Controls Accept header.
Schema: UserDTO

GET /api/authorities

Parameters

no parameters

Responses

Code

Description

200

OK
Media type: */*
Controls Accept header.
Schema: string array of authorities

schemas

AdminUserDTO
AdminUserDTO {
id	integer($int64)
login*	string
maxLength: 50
minLength: 1
pattern: ^(?>[a-zA-Z0-9!$&*+=?^_`{|}~.-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*)|(?>[_.@A-Za-z0-9-]+)$
firstName	string
maxLength: 50
minLength: 0
lastName	string
maxLength: 50
minLength: 0
email	string
maxLength: 254
minLength: 5
imageUrl	string
maxLength: 256
minLength: 0
activated	boolean
langKey	string
maxLength: 10
minLength: 2
createdBy	string
createdDate	string($date-time)
lastModifiedBy	string
lastModifiedDate	string($date-time)
authorities	[
uniqueItems: true
string]
}
ManagedUserVM
ManagedUserVM {
id	integer($int64)
login*	string
maxLength: 50
minLength: 1
pattern: ^(?>[a-zA-Z0-9!$&*+=?^_`{|}~.-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*)|(?>[_.@A-Za-z0-9-]+)$
firstName	string
maxLength: 50
minLength: 0
lastName	string
maxLength: 50
minLength: 0
email	string
maxLength: 254
minLength: 5
imageUrl	string
maxLength: 256
minLength: 0
activated	boolean
langKey	string
maxLength: 10
minLength: 2
createdBy	string
createdDate	string($date-time)
lastModifiedBy	string
lastModifiedDate	string($date-time)
authorities	[...]
password	string
maxLength: 100
minLength: 4
}
LoginVM
LoginVM {
username*	string
maxLength: 50
minLength: 1
password*	string
maxLength: 100
minLength: 4
rememberMe	boolean
}
JWTToken
JWTToken {
id_token	string
}
User
User {
id	integer($int64)
login*	string
maxLength: 50
minLength: 1
pattern: ^(?>[a-zA-Z0-9!$&*+=?^_`{|}~.-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*)|(?>[_.@A-Za-z0-9-]+)$
firstName	string
maxLength: 50
minLength: 0
lastName	string
maxLength: 50
minLength: 0
email	string
maxLength: 254
minLength: 5
activated*	boolean
langKey	string
maxLength: 10
minLength: 2
imageUrl	string
maxLength: 256
minLength: 0
resetDate	string($date-time)
}
KeyAndPasswordVM
KeyAndPasswordVM {
key	string
newPassword	string
}
PasswordChangeDTO
PasswordChangeDTO {
currentPassword	string
newPassword	string
}
UserDTO
UserDTO {
id	integer($int64)
login	string
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages