horizoncd/horizon

View on GitHub
openapi/v2/restful/user.yaml

Summary

Maintainability
Test Coverage
# Copyright © 2023 Horizoncd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
 
openapi: 3.0.2
info:
version: 2.0.0
title: User Management API
description: This API allows clients to retrieve and search for users in the system.
servers:
- url: 'http://localhost:8080/'
paths:
/apis/core/v2/users:
get:
tags:
- user
summary: Search for users
parameters:
- name: filter
in: query
required: false
schema:
type: string
description: A string to filter the results by.
- name: pageNumber
in: query
required: false
schema:
type: integer
description: The page number of the results.
- name: pageSize
in: query
required: false
schema:
type: integer
description: The number of items to include on each page of the results.
- name: userType
in: query
required: false
schema:
type: integer
description: The type of user to include in the results.
responses:
200:
description: Success
content:
application/json:
schema:
$ref: 'common.yaml#/components/schemas/userList'
 
/apis/core/v2/users/{id}:
get:
tags:
- user
summary: Retrieve a user by ID
parameters:
- name: id
in: path
required: true
schema:
type: integer
responses:
200:
description: Success
content:
application/json:
schema:
$ref: 'common.yaml#/components/schemas/user'
put:
tags:
- user
summary: Update a user by ID
parameters:
- name: id
in: path
required: true
schema:
type: integer
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
isBanned:
type: boolean
description: Whether the user should be banned.
isAdmin:
type: boolean
description: Whether the user should be made an administrator.
responses:
200:
description: Success
content:
application/json:
$ref: 'common.yaml#/components/schemas/user'
 
/apis/core/v2/users/self:
get:
tags:
- user
summary: Retrieve a data for your self
responses:
200:
description: Success
content:
application/json:
$ref: 'common.yaml#/components/schemas/user'
 
/apis/core/v2/users/{id}/links:
get:
tags:
- link
- user
summary: Retrieve links for a user by ID
parameters:
- name: id
in: path
required: true
schema:
type: integer
responses:
200:
description: Success
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
type: object
properties:
id:
type: integer
description: The unique ID of the link.
sub:
type: string
description: The unique subject identifier of the user in the identity provider's system.
idpId:
type: integer
description: The unique ID of the identity provider.
userId:
type: integer
description: The unique ID of the user in the system.
name:
type: string
description: The name of the user.
email:
type: string
description: The email address of the user.
unlinkable:
type: boolean
description: Whether the link can be unlinked by the user.
 
/apis/core/v2/links/{id}:
delete:
tags:
- link
- user
summary: Delete a link by ID
parameters:
- name: id
in: path
required: true
schema:
type: integer
responses:
200:
description: Success
content:
application/json:
schema:
type: object
properties:
data:
type: object
properties:
id:
type: integer
description: The unique ID of the link.
sub:
type: string
description: The unique subject identifier of the user in the identity provider's system.
idpId:
type: integer
description: The unique ID of the identity provider.
userId:
type: integer
description: The unique ID of the user in the system.
name:
type: string
description: The name of the user.
email:
type: string
description: The email address of the user.
unlinkable:
type: boolean
description: Whether the link can be unlinked by the user.