Return user info in the peer API response

This commit is contained in:
braginini
2022-09-23 18:32:25 +02:00
parent 6bee984b46
commit 5d197cd5f9
3 changed files with 33 additions and 15 deletions

View File

@@ -44,6 +44,18 @@ components:
- name
- role
- auto_groups
UserMinimum:
type: object
properties:
id:
description: User ID
type: string
email:
description: User's email address
type: string
name:
description: User's name from idp provider
type: string
UserRequest:
type: object
properties:
@@ -110,12 +122,8 @@ components:
ssh_enabled:
description: Indicates whether SSH server is enabled on this peer
type: boolean
user_email:
description: User Email that this peer was added by
type: string
user_name:
description: User full name that this peer was added by
type: string
user:
$ref: '#/components/schemas/UserMinimum'
host_name:
description: Peer's hostname
type: string

View File

@@ -156,13 +156,8 @@ type Peer struct {
Os string `json:"os"`
// Indicates whether SSH server is enabled on this peer
SshEnabled bool `json:"ssh_enabled"`
// User Email that this peer was added by
UserEmail *string `json:"user_email,omitempty"`
// User full name that this peer was added by
UserName *string `json:"user_name,omitempty"`
SshEnabled bool `json:"ssh_enabled"`
User *UserMinimum `json:"user,omitempty"`
// Peer's daemon or cli version
Version string `json:"version"`
@@ -381,6 +376,18 @@ type User struct {
Role string `json:"role"`
}
// UserMinimum defines model for UserMinimum.
type UserMinimum struct {
// User's email address
Email *string `json:"email,omitempty"`
// User ID
Id *string `json:"id,omitempty"`
// User's name from idp provider
Name *string `json:"name,omitempty"`
}
// UserRequest defines model for UserRequest.
type UserRequest struct {
// Groups to auto-assign to peers registered by this user