mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-26 20:26:39 +00:00
Merge branch 'refs/heads/main' into prototype/reverse-proxy
# Conflicts: # management/server/activity/codes.go # management/server/http/handler.go # management/server/store/sql_store.go # management/server/store/store.go # shared/management/http/api/openapi.yml # shared/management/http/api/types.gen.go # shared/management/proto/management.pb.go
This commit is contained in:
@@ -11,6 +11,6 @@ fi
|
||||
old_pwd=$(pwd)
|
||||
script_path=$(dirname $(realpath "$0"))
|
||||
cd "$script_path"
|
||||
go install github.com/deepmap/oapi-codegen/cmd/oapi-codegen@4a1477f6a8ba6ca8115cc23bb2fb67f0b9fca18e
|
||||
go install github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen@latest
|
||||
oapi-codegen --config cfg.yaml openapi.yml
|
||||
cd "$old_pwd"
|
||||
cd "$old_pwd"
|
||||
|
||||
@@ -40,8 +40,142 @@ tags:
|
||||
description: Interact with and view information about reverse proxies.
|
||||
- name: Instance
|
||||
description: Instance setup and status endpoints for initial configuration.
|
||||
- name: Jobs
|
||||
description: Interact with and view information about remote jobs.
|
||||
x-experimental: true
|
||||
|
||||
components:
|
||||
schemas:
|
||||
PasswordChangeRequest:
|
||||
type: object
|
||||
properties:
|
||||
old_password:
|
||||
description: The current password
|
||||
type: string
|
||||
example: "currentPassword123"
|
||||
new_password:
|
||||
description: The new password to set
|
||||
type: string
|
||||
example: "newSecurePassword456"
|
||||
required:
|
||||
- old_password
|
||||
- new_password
|
||||
WorkloadType:
|
||||
type: string
|
||||
description: |
|
||||
Identifies the type of workload the job will execute.
|
||||
Currently only `"bundle"` is supported.
|
||||
enum:
|
||||
- bundle
|
||||
example: "bundle"
|
||||
BundleParameters:
|
||||
type: object
|
||||
description: These parameters control what gets included in the bundle and how it is processed.
|
||||
properties:
|
||||
bundle_for:
|
||||
type: boolean
|
||||
description: Whether to generate a bundle for the given timeframe.
|
||||
example: true
|
||||
bundle_for_time:
|
||||
type: integer
|
||||
minimum: 1
|
||||
maximum: 5
|
||||
description: Time period in minutes for which to generate the bundle.
|
||||
example: 2
|
||||
log_file_count:
|
||||
type: integer
|
||||
minimum: 1
|
||||
maximum: 1000
|
||||
description: Maximum number of log files to include in the bundle.
|
||||
example: 100
|
||||
anonymize:
|
||||
type: boolean
|
||||
description: Whether sensitive data should be anonymized in the bundle.
|
||||
example: false
|
||||
required:
|
||||
- bundle_for
|
||||
- bundle_for_time
|
||||
- log_file_count
|
||||
- anonymize
|
||||
BundleResult:
|
||||
type: object
|
||||
properties:
|
||||
upload_key:
|
||||
type: string
|
||||
example: "upload_key_123"
|
||||
nullable: true
|
||||
BundleWorkloadRequest:
|
||||
type: object
|
||||
properties:
|
||||
type:
|
||||
$ref: '#/components/schemas/WorkloadType'
|
||||
parameters:
|
||||
$ref: '#/components/schemas/BundleParameters'
|
||||
required:
|
||||
- type
|
||||
- parameters
|
||||
BundleWorkloadResponse:
|
||||
type: object
|
||||
properties:
|
||||
type:
|
||||
$ref: '#/components/schemas/WorkloadType'
|
||||
parameters:
|
||||
$ref: '#/components/schemas/BundleParameters'
|
||||
result:
|
||||
$ref: '#/components/schemas/BundleResult'
|
||||
required:
|
||||
- type
|
||||
- parameters
|
||||
- result
|
||||
WorkloadRequest:
|
||||
oneOf:
|
||||
- $ref: '#/components/schemas/BundleWorkloadRequest'
|
||||
discriminator:
|
||||
propertyName: type
|
||||
mapping:
|
||||
bundle: '#/components/schemas/BundleWorkloadRequest'
|
||||
WorkloadResponse:
|
||||
oneOf:
|
||||
- $ref: '#/components/schemas/BundleWorkloadResponse'
|
||||
discriminator:
|
||||
propertyName: type
|
||||
mapping:
|
||||
bundle: '#/components/schemas/BundleWorkloadResponse'
|
||||
JobRequest:
|
||||
type: object
|
||||
properties:
|
||||
workload:
|
||||
$ref: '#/components/schemas/WorkloadRequest'
|
||||
required:
|
||||
- workload
|
||||
JobResponse:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
created_at:
|
||||
type: string
|
||||
format: date-time
|
||||
completed_at:
|
||||
type: string
|
||||
format: date-time
|
||||
nullable: true
|
||||
triggered_by:
|
||||
type: string
|
||||
status:
|
||||
type: string
|
||||
enum: [pending, succeeded, failed]
|
||||
failed_reason:
|
||||
type: string
|
||||
nullable: true
|
||||
workload:
|
||||
$ref: '#/components/schemas/WorkloadResponse'
|
||||
required:
|
||||
- id
|
||||
- created_at
|
||||
- status
|
||||
- triggered_by
|
||||
- workload
|
||||
Account:
|
||||
type: object
|
||||
properties:
|
||||
@@ -356,6 +490,171 @@ components:
|
||||
- role
|
||||
- auto_groups
|
||||
- is_service_user
|
||||
UserInviteCreateRequest:
|
||||
type: object
|
||||
description: Request to create a user invite link
|
||||
properties:
|
||||
email:
|
||||
description: User's email address
|
||||
type: string
|
||||
example: user@example.com
|
||||
name:
|
||||
description: User's full name
|
||||
type: string
|
||||
example: John Doe
|
||||
role:
|
||||
description: User's NetBird account role
|
||||
type: string
|
||||
example: user
|
||||
auto_groups:
|
||||
description: Group IDs to auto-assign to peers registered by this user
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
example: ch8i4ug6lnn4g9hqv7m0
|
||||
expires_in:
|
||||
description: Invite expiration time in seconds (default 72 hours)
|
||||
type: integer
|
||||
example: 259200
|
||||
required:
|
||||
- email
|
||||
- name
|
||||
- role
|
||||
- auto_groups
|
||||
UserInvite:
|
||||
type: object
|
||||
description: A user invite
|
||||
properties:
|
||||
id:
|
||||
description: Invite ID
|
||||
type: string
|
||||
example: d5p7eedra0h0lt6f59hg
|
||||
email:
|
||||
description: User's email address
|
||||
type: string
|
||||
example: user@example.com
|
||||
name:
|
||||
description: User's full name
|
||||
type: string
|
||||
example: John Doe
|
||||
role:
|
||||
description: User's NetBird account role
|
||||
type: string
|
||||
example: user
|
||||
auto_groups:
|
||||
description: Group IDs to auto-assign to peers registered by this user
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
example: ch8i4ug6lnn4g9hqv7m0
|
||||
expires_at:
|
||||
description: Invite expiration time
|
||||
type: string
|
||||
format: date-time
|
||||
example: "2024-01-25T10:00:00Z"
|
||||
created_at:
|
||||
description: Invite creation time
|
||||
type: string
|
||||
format: date-time
|
||||
example: "2024-01-22T10:00:00Z"
|
||||
expired:
|
||||
description: Whether the invite has expired
|
||||
type: boolean
|
||||
example: false
|
||||
invite_token:
|
||||
description: The invite link to be shared with the user. Only returned when the invite is created or regenerated.
|
||||
type: string
|
||||
example: nbi_Xk5Lz9mP2vQwRtYu1aN3bC4dE5fGh0ABC123
|
||||
required:
|
||||
- id
|
||||
- email
|
||||
- name
|
||||
- role
|
||||
- auto_groups
|
||||
- expires_at
|
||||
- created_at
|
||||
- expired
|
||||
UserInviteInfo:
|
||||
type: object
|
||||
description: Public information about an invite
|
||||
properties:
|
||||
email:
|
||||
description: User's email address
|
||||
type: string
|
||||
example: user@example.com
|
||||
name:
|
||||
description: User's full name
|
||||
type: string
|
||||
example: John Doe
|
||||
expires_at:
|
||||
description: Invite expiration time
|
||||
type: string
|
||||
format: date-time
|
||||
example: "2024-01-25T10:00:00Z"
|
||||
valid:
|
||||
description: Whether the invite is still valid (not expired)
|
||||
type: boolean
|
||||
example: true
|
||||
invited_by:
|
||||
description: Name of the user who sent the invite
|
||||
type: string
|
||||
example: Admin User
|
||||
required:
|
||||
- email
|
||||
- name
|
||||
- expires_at
|
||||
- valid
|
||||
- invited_by
|
||||
UserInviteAcceptRequest:
|
||||
type: object
|
||||
description: Request to accept an invite and set password
|
||||
properties:
|
||||
password:
|
||||
description: >-
|
||||
The password the user wants to set. Must be at least 8 characters long
|
||||
and contain at least one uppercase letter, one digit, and one special
|
||||
character (any character that is not a letter or digit, including spaces).
|
||||
type: string
|
||||
format: password
|
||||
minLength: 8
|
||||
pattern: '^(?=.*[0-9])(?=.*[A-Z])(?=.*[^a-zA-Z0-9]).{8,}$'
|
||||
example: SecurePass123!
|
||||
required:
|
||||
- password
|
||||
UserInviteAcceptResponse:
|
||||
type: object
|
||||
description: Response after accepting an invite
|
||||
properties:
|
||||
success:
|
||||
description: Whether the invite was accepted successfully
|
||||
type: boolean
|
||||
example: true
|
||||
required:
|
||||
- success
|
||||
UserInviteRegenerateRequest:
|
||||
type: object
|
||||
description: Request to regenerate an invite link
|
||||
properties:
|
||||
expires_in:
|
||||
description: Invite expiration time in seconds (default 72 hours)
|
||||
type: integer
|
||||
example: 259200
|
||||
UserInviteRegenerateResponse:
|
||||
type: object
|
||||
description: Response after regenerating an invite
|
||||
properties:
|
||||
invite_token:
|
||||
description: The new invite token
|
||||
type: string
|
||||
example: nbi_Xk5Lz9mP2vQwRtYu1aN3bC4dE5fGh0ABC123
|
||||
invite_expires_at:
|
||||
description: New invite expiration time
|
||||
type: string
|
||||
format: date-time
|
||||
example: "2024-01-28T10:00:00Z"
|
||||
required:
|
||||
- invite_token
|
||||
- invite_expires_at
|
||||
PeerMinimum:
|
||||
type: object
|
||||
properties:
|
||||
@@ -1896,19 +2195,53 @@ components:
|
||||
activity_code:
|
||||
description: The string code of the activity that occurred during the event
|
||||
type: string
|
||||
enum: [ "user.peer.delete", "user.join", "user.invite", "user.peer.add", "user.group.add", "user.group.delete",
|
||||
"user.role.update", "user.block", "user.unblock", "user.peer.login",
|
||||
"setupkey.peer.add", "setupkey.add", "setupkey.update", "setupkey.revoke", "setupkey.overuse",
|
||||
"setupkey.group.delete", "setupkey.group.add",
|
||||
"rule.add", "rule.delete", "rule.update",
|
||||
"policy.add", "policy.delete", "policy.update",
|
||||
"group.add", "group.update", "dns.setting.disabled.management.group.add", "dns.setting.disabled.management.group.delete",
|
||||
"account.create", "account.setting.peer.login.expiration.update", "account.setting.peer.login.expiration.disable", "account.setting.peer.login.expiration.enable",
|
||||
"route.add", "route.delete", "route.update",
|
||||
"nameserver.group.add", "nameserver.group.delete", "nameserver.group.update",
|
||||
"peer.ssh.disable", "peer.ssh.enable", "peer.rename", "peer.login.expiration.disable", "peer.login.expiration.enable", "peer.login.expire",
|
||||
"service.user.create", "personal.access.token.create", "service.user.delete", "personal.access.token.delete",
|
||||
"service.create", "service.update", "service.delete" ]
|
||||
enum: [
|
||||
"peer.user.add", "peer.setupkey.add", "user.join", "user.invite", "account.create", "account.delete",
|
||||
"user.peer.delete", "rule.add", "rule.update", "rule.delete",
|
||||
"policy.add", "policy.update", "policy.delete",
|
||||
"setupkey.add", "setupkey.update", "setupkey.revoke", "setupkey.overuse", "setupkey.delete",
|
||||
"group.add", "group.update", "group.delete",
|
||||
"peer.group.add", "peer.group.delete",
|
||||
"user.group.add", "user.group.delete", "user.role.update",
|
||||
"setupkey.group.add", "setupkey.group.delete",
|
||||
"dns.setting.disabled.management.group.add", "dns.setting.disabled.management.group.delete",
|
||||
"route.add", "route.delete", "route.update",
|
||||
"peer.ssh.enable", "peer.ssh.disable", "peer.rename",
|
||||
"peer.login.expiration.enable", "peer.login.expiration.disable",
|
||||
"nameserver.group.add", "nameserver.group.delete", "nameserver.group.update",
|
||||
"account.setting.peer.login.expiration.update", "account.setting.peer.login.expiration.enable", "account.setting.peer.login.expiration.disable",
|
||||
"personal.access.token.create", "personal.access.token.delete",
|
||||
"service.user.create", "service.user.delete",
|
||||
"user.block", "user.unblock", "user.delete",
|
||||
"user.peer.login", "peer.login.expire",
|
||||
"dashboard.login",
|
||||
"integration.create", "integration.update", "integration.delete",
|
||||
"account.setting.peer.approval.enable", "account.setting.peer.approval.disable",
|
||||
"peer.approve", "peer.approval.revoke",
|
||||
"transferred.owner.role",
|
||||
"posture.check.create", "posture.check.update", "posture.check.delete",
|
||||
"peer.inactivity.expiration.enable", "peer.inactivity.expiration.disable",
|
||||
"account.peer.inactivity.expiration.enable", "account.peer.inactivity.expiration.disable", "account.peer.inactivity.expiration.update",
|
||||
"account.setting.group.propagation.enable", "account.setting.group.propagation.disable",
|
||||
"account.setting.routing.peer.dns.resolution.enable", "account.setting.routing.peer.dns.resolution.disable",
|
||||
"network.create", "network.update", "network.delete",
|
||||
"network.resource.create", "network.resource.update", "network.resource.delete",
|
||||
"network.router.create", "network.router.update", "network.router.delete",
|
||||
"resource.group.add", "resource.group.delete",
|
||||
"account.dns.domain.update",
|
||||
"account.setting.lazy.connection.enable", "account.setting.lazy.connection.disable",
|
||||
"account.network.range.update",
|
||||
"peer.ip.update",
|
||||
"user.approve", "user.reject", "user.create",
|
||||
"account.settings.auto.version.update",
|
||||
"identityprovider.create", "identityprovider.update", "identityprovider.delete",
|
||||
"dns.zone.create", "dns.zone.update", "dns.zone.delete",
|
||||
"dns.zone.record.create", "dns.zone.record.update", "dns.zone.record.delete",
|
||||
"peer.job.create",
|
||||
"user.password.change",
|
||||
"user.invite.link.create", "user.invite.link.accept", "user.invite.link.regenerate", "user.invite.link.delete",
|
||||
"service.create", "service.update", "service.delete"
|
||||
]
|
||||
example: route.add
|
||||
initiator_id:
|
||||
description: The ID of the initiator of the event. E.g., an ID of a user that triggered the event.
|
||||
@@ -2628,6 +2961,29 @@ components:
|
||||
required:
|
||||
- user_id
|
||||
- email
|
||||
InstanceVersionInfo:
|
||||
type: object
|
||||
description: Version information for NetBird components
|
||||
properties:
|
||||
management_current_version:
|
||||
description: The current running version of the management server
|
||||
type: string
|
||||
example: "0.35.0"
|
||||
dashboard_available_version:
|
||||
description: The latest available version of the dashboard (from GitHub releases)
|
||||
type: string
|
||||
example: "2.10.0"
|
||||
management_available_version:
|
||||
description: The latest available version of the management server (from GitHub releases)
|
||||
type: string
|
||||
example: "0.35.0"
|
||||
management_update_available:
|
||||
description: Indicates if a newer management version is available
|
||||
type: boolean
|
||||
example: true
|
||||
required:
|
||||
- management_current_version
|
||||
- management_update_available
|
||||
responses:
|
||||
not_found:
|
||||
description: Resource not found
|
||||
@@ -2680,6 +3036,27 @@ paths:
|
||||
$ref: '#/components/schemas/InstanceStatus'
|
||||
'500':
|
||||
"$ref": "#/components/responses/internal_error"
|
||||
/api/instance/version:
|
||||
get:
|
||||
summary: Get Version Info
|
||||
description: Returns version information for NetBird components including the current management server version and latest available versions from GitHub.
|
||||
tags: [ Instance ]
|
||||
security:
|
||||
- BearerAuth: []
|
||||
- TokenAuth: []
|
||||
responses:
|
||||
'200':
|
||||
description: Version information
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/InstanceVersionInfo'
|
||||
'401':
|
||||
"$ref": "#/components/responses/requires_authentication"
|
||||
'403':
|
||||
"$ref": "#/components/responses/forbidden"
|
||||
'500':
|
||||
"$ref": "#/components/responses/internal_error"
|
||||
/api/setup:
|
||||
post:
|
||||
summary: Setup Instance
|
||||
@@ -2707,6 +3084,110 @@ paths:
|
||||
content: { }
|
||||
'500':
|
||||
"$ref": "#/components/responses/internal_error"
|
||||
/api/peers/{peerId}/jobs:
|
||||
get:
|
||||
summary: List Jobs
|
||||
description: Retrieve all jobs for a given peer
|
||||
tags: [ Jobs ]
|
||||
security:
|
||||
- BearerAuth: []
|
||||
- TokenAuth: []
|
||||
parameters:
|
||||
- in: path
|
||||
name: peerId
|
||||
description: The unique identifier of a peer
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
description: List of jobs
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/JobResponse'
|
||||
'400':
|
||||
$ref: '#/components/responses/bad_request'
|
||||
'401':
|
||||
$ref: '#/components/responses/requires_authentication'
|
||||
'403':
|
||||
$ref: '#/components/responses/forbidden'
|
||||
'500':
|
||||
$ref: '#/components/responses/internal_error'
|
||||
post:
|
||||
summary: Create Job
|
||||
description: Create a new job for a given peer
|
||||
tags: [ Jobs ]
|
||||
security:
|
||||
- BearerAuth: []
|
||||
- TokenAuth: []
|
||||
parameters:
|
||||
- in: path
|
||||
name: peerId
|
||||
description: The unique identifier of a peer
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
requestBody:
|
||||
description: Create job request
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/JobRequest'
|
||||
required: true
|
||||
responses:
|
||||
'201':
|
||||
description: Job created
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/JobResponse'
|
||||
'400':
|
||||
"$ref": "#/components/responses/bad_request"
|
||||
'401':
|
||||
"$ref": "#/components/responses/requires_authentication"
|
||||
'403':
|
||||
"$ref": "#/components/responses/forbidden"
|
||||
'500':
|
||||
"$ref": "#/components/responses/internal_error"
|
||||
/api/peers/{peerId}/jobs/{jobId}:
|
||||
get:
|
||||
summary: Get Job
|
||||
description: Retrieve details of a specific job
|
||||
tags: [ Jobs ]
|
||||
security:
|
||||
- BearerAuth: []
|
||||
- TokenAuth: []
|
||||
parameters:
|
||||
- in: path
|
||||
name: peerId
|
||||
required: true
|
||||
description: The unique identifier of a peer
|
||||
schema:
|
||||
type: string
|
||||
- in: path
|
||||
name: jobId
|
||||
required: true
|
||||
description: The unique identifier of a job
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
description: A Job object
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/JobResponse'
|
||||
'400':
|
||||
"$ref": "#/components/responses/bad_request"
|
||||
'401':
|
||||
"$ref": "#/components/responses/requires_authentication"
|
||||
'403':
|
||||
"$ref": "#/components/responses/forbidden"
|
||||
'500':
|
||||
"$ref": "#/components/responses/internal_error"
|
||||
/api/accounts:
|
||||
get:
|
||||
summary: List all Accounts
|
||||
@@ -3134,6 +3615,43 @@ paths:
|
||||
"$ref": "#/components/responses/forbidden"
|
||||
'500':
|
||||
"$ref": "#/components/responses/internal_error"
|
||||
/api/users/{userId}/password:
|
||||
put:
|
||||
summary: Change user password
|
||||
description: Change the password for a user. Only available when embedded IdP is enabled. Users can only change their own password.
|
||||
tags: [ Users ]
|
||||
security:
|
||||
- BearerAuth: [ ]
|
||||
- TokenAuth: [ ]
|
||||
parameters:
|
||||
- in: path
|
||||
name: userId
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
description: The unique identifier of a user
|
||||
requestBody:
|
||||
description: Password change request
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/PasswordChangeRequest'
|
||||
responses:
|
||||
'200':
|
||||
description: Password changed successfully
|
||||
content: {}
|
||||
'400':
|
||||
"$ref": "#/components/responses/bad_request"
|
||||
'401':
|
||||
"$ref": "#/components/responses/requires_authentication"
|
||||
'403':
|
||||
"$ref": "#/components/responses/forbidden"
|
||||
'412':
|
||||
description: Precondition failed - embedded IdP is not enabled
|
||||
content: { }
|
||||
'500':
|
||||
"$ref": "#/components/responses/internal_error"
|
||||
/api/users/current:
|
||||
get:
|
||||
summary: Retrieve current user
|
||||
@@ -3157,6 +3675,210 @@ paths:
|
||||
"$ref": "#/components/responses/forbidden"
|
||||
'500':
|
||||
"$ref": "#/components/responses/internal_error"
|
||||
/api/users/invites:
|
||||
get:
|
||||
summary: List user invites
|
||||
description: Lists all pending invites for the account. Only available when embedded IdP is enabled.
|
||||
tags: [ Users ]
|
||||
security:
|
||||
- BearerAuth: [ ]
|
||||
- TokenAuth: [ ]
|
||||
responses:
|
||||
'200':
|
||||
description: List of invites
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/UserInvite'
|
||||
'401':
|
||||
"$ref": "#/components/responses/requires_authentication"
|
||||
'403':
|
||||
"$ref": "#/components/responses/forbidden"
|
||||
'412':
|
||||
description: Precondition failed - embedded IdP is not enabled
|
||||
content: { }
|
||||
'500':
|
||||
"$ref": "#/components/responses/internal_error"
|
||||
post:
|
||||
summary: Create a user invite
|
||||
description: Creates an invite link for a new user. Only available when embedded IdP is enabled. The user is not created until they accept the invite.
|
||||
tags: [ Users ]
|
||||
security:
|
||||
- BearerAuth: [ ]
|
||||
- TokenAuth: [ ]
|
||||
requestBody:
|
||||
description: User invite information
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/UserInviteCreateRequest'
|
||||
responses:
|
||||
'200':
|
||||
description: Invite created successfully
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/UserInvite'
|
||||
'400':
|
||||
"$ref": "#/components/responses/bad_request"
|
||||
'401':
|
||||
"$ref": "#/components/responses/requires_authentication"
|
||||
'403':
|
||||
"$ref": "#/components/responses/forbidden"
|
||||
'409':
|
||||
description: User or invite already exists
|
||||
content: { }
|
||||
'412':
|
||||
description: Precondition failed - embedded IdP is not enabled
|
||||
content: { }
|
||||
'422':
|
||||
"$ref": "#/components/responses/validation_failed"
|
||||
'500':
|
||||
"$ref": "#/components/responses/internal_error"
|
||||
/api/users/invites/{inviteId}:
|
||||
delete:
|
||||
summary: Delete a user invite
|
||||
description: Deletes a pending invite. Only available when embedded IdP is enabled.
|
||||
tags: [ Users ]
|
||||
security:
|
||||
- BearerAuth: [ ]
|
||||
- TokenAuth: [ ]
|
||||
parameters:
|
||||
- in: path
|
||||
name: inviteId
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
description: The ID of the invite to delete
|
||||
responses:
|
||||
'200':
|
||||
description: Invite deleted successfully
|
||||
content: { }
|
||||
'401':
|
||||
"$ref": "#/components/responses/requires_authentication"
|
||||
'403':
|
||||
"$ref": "#/components/responses/forbidden"
|
||||
'404':
|
||||
description: Invite not found
|
||||
content: { }
|
||||
'412':
|
||||
description: Precondition failed - embedded IdP is not enabled
|
||||
content: { }
|
||||
'500':
|
||||
"$ref": "#/components/responses/internal_error"
|
||||
/api/users/invites/{inviteId}/regenerate:
|
||||
post:
|
||||
summary: Regenerate a user invite
|
||||
description: Regenerates an invite link for an existing invite. Invalidates the previous token and creates a new one.
|
||||
tags: [ Users ]
|
||||
security:
|
||||
- BearerAuth: [ ]
|
||||
- TokenAuth: [ ]
|
||||
parameters:
|
||||
- in: path
|
||||
name: inviteId
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
description: The ID of the invite to regenerate
|
||||
requestBody:
|
||||
description: Regenerate options
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/UserInviteRegenerateRequest'
|
||||
responses:
|
||||
'200':
|
||||
description: Invite regenerated successfully
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/UserInviteRegenerateResponse'
|
||||
'400':
|
||||
"$ref": "#/components/responses/bad_request"
|
||||
'401':
|
||||
"$ref": "#/components/responses/requires_authentication"
|
||||
'403':
|
||||
"$ref": "#/components/responses/forbidden"
|
||||
'404':
|
||||
description: Invite not found
|
||||
content: { }
|
||||
'412':
|
||||
description: Precondition failed - embedded IdP is not enabled
|
||||
content: { }
|
||||
'422':
|
||||
"$ref": "#/components/responses/validation_failed"
|
||||
'500':
|
||||
"$ref": "#/components/responses/internal_error"
|
||||
/api/users/invites/{token}:
|
||||
get:
|
||||
summary: Get invite information
|
||||
description: Retrieves public information about an invite. This endpoint is unauthenticated and protected by the token itself.
|
||||
tags: [ Users ]
|
||||
security: []
|
||||
parameters:
|
||||
- in: path
|
||||
name: token
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
description: The invite token
|
||||
responses:
|
||||
'200':
|
||||
description: Invite information
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/UserInviteInfo'
|
||||
'400':
|
||||
"$ref": "#/components/responses/bad_request"
|
||||
'404':
|
||||
description: Invite not found or invalid token
|
||||
content: { }
|
||||
'500':
|
||||
"$ref": "#/components/responses/internal_error"
|
||||
/api/users/invites/{token}/accept:
|
||||
post:
|
||||
summary: Accept an invite
|
||||
description: Accepts an invite and creates the user with the provided password. This endpoint is unauthenticated and protected by the token itself.
|
||||
tags: [ Users ]
|
||||
security: []
|
||||
parameters:
|
||||
- in: path
|
||||
name: token
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
description: The invite token
|
||||
requestBody:
|
||||
description: Password to set for the new user
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/UserInviteAcceptRequest'
|
||||
responses:
|
||||
'200':
|
||||
description: Invite accepted successfully
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/UserInviteAcceptResponse'
|
||||
'400':
|
||||
"$ref": "#/components/responses/bad_request"
|
||||
'404':
|
||||
description: Invite not found or invalid token
|
||||
content: { }
|
||||
'412':
|
||||
description: Precondition failed - embedded IdP is not enabled or invite expired
|
||||
content: { }
|
||||
'422':
|
||||
"$ref": "#/components/responses/validation_failed"
|
||||
'500':
|
||||
"$ref": "#/components/responses/internal_error"
|
||||
/api/peers:
|
||||
get:
|
||||
summary: List all Peers
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
// Package api provides primitives to interact with the openapi HTTP API.
|
||||
//
|
||||
// Code generated by github.com/deepmap/oapi-codegen version v1.11.1-0.20220912230023-4a1477f6a8ba DO NOT EDIT.
|
||||
// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.5.1 DO NOT EDIT.
|
||||
package api
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"time"
|
||||
|
||||
"github.com/oapi-codegen/runtime"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -21,56 +25,115 @@ const (
|
||||
|
||||
// Defines values for EventActivityCode.
|
||||
const (
|
||||
EventActivityCodeAccountCreate EventActivityCode = "account.create"
|
||||
EventActivityCodeAccountSettingPeerLoginExpirationDisable EventActivityCode = "account.setting.peer.login.expiration.disable"
|
||||
EventActivityCodeAccountSettingPeerLoginExpirationEnable EventActivityCode = "account.setting.peer.login.expiration.enable"
|
||||
EventActivityCodeAccountSettingPeerLoginExpirationUpdate EventActivityCode = "account.setting.peer.login.expiration.update"
|
||||
EventActivityCodeDnsSettingDisabledManagementGroupAdd EventActivityCode = "dns.setting.disabled.management.group.add"
|
||||
EventActivityCodeDnsSettingDisabledManagementGroupDelete EventActivityCode = "dns.setting.disabled.management.group.delete"
|
||||
EventActivityCodeGroupAdd EventActivityCode = "group.add"
|
||||
EventActivityCodeGroupUpdate EventActivityCode = "group.update"
|
||||
EventActivityCodeNameserverGroupAdd EventActivityCode = "nameserver.group.add"
|
||||
EventActivityCodeNameserverGroupDelete EventActivityCode = "nameserver.group.delete"
|
||||
EventActivityCodeNameserverGroupUpdate EventActivityCode = "nameserver.group.update"
|
||||
EventActivityCodePeerLoginExpirationDisable EventActivityCode = "peer.login.expiration.disable"
|
||||
EventActivityCodePeerLoginExpirationEnable EventActivityCode = "peer.login.expiration.enable"
|
||||
EventActivityCodePeerLoginExpire EventActivityCode = "peer.login.expire"
|
||||
EventActivityCodePeerRename EventActivityCode = "peer.rename"
|
||||
EventActivityCodePeerSshDisable EventActivityCode = "peer.ssh.disable"
|
||||
EventActivityCodePeerSshEnable EventActivityCode = "peer.ssh.enable"
|
||||
EventActivityCodePersonalAccessTokenCreate EventActivityCode = "personal.access.token.create"
|
||||
EventActivityCodePersonalAccessTokenDelete EventActivityCode = "personal.access.token.delete"
|
||||
EventActivityCodePolicyAdd EventActivityCode = "policy.add"
|
||||
EventActivityCodePolicyDelete EventActivityCode = "policy.delete"
|
||||
EventActivityCodePolicyUpdate EventActivityCode = "policy.update"
|
||||
EventActivityCodeRouteAdd EventActivityCode = "route.add"
|
||||
EventActivityCodeRouteDelete EventActivityCode = "route.delete"
|
||||
EventActivityCodeRouteUpdate EventActivityCode = "route.update"
|
||||
EventActivityCodeRuleAdd EventActivityCode = "rule.add"
|
||||
EventActivityCodeRuleDelete EventActivityCode = "rule.delete"
|
||||
EventActivityCodeRuleUpdate EventActivityCode = "rule.update"
|
||||
EventActivityCodeServiceCreate EventActivityCode = "service.create"
|
||||
EventActivityCodeServiceDelete EventActivityCode = "service.delete"
|
||||
EventActivityCodeServiceUpdate EventActivityCode = "service.update"
|
||||
EventActivityCodeServiceUserCreate EventActivityCode = "service.user.create"
|
||||
EventActivityCodeServiceUserDelete EventActivityCode = "service.user.delete"
|
||||
EventActivityCodeSetupkeyAdd EventActivityCode = "setupkey.add"
|
||||
EventActivityCodeSetupkeyGroupAdd EventActivityCode = "setupkey.group.add"
|
||||
EventActivityCodeSetupkeyGroupDelete EventActivityCode = "setupkey.group.delete"
|
||||
EventActivityCodeSetupkeyOveruse EventActivityCode = "setupkey.overuse"
|
||||
EventActivityCodeSetupkeyPeerAdd EventActivityCode = "setupkey.peer.add"
|
||||
EventActivityCodeSetupkeyRevoke EventActivityCode = "setupkey.revoke"
|
||||
EventActivityCodeSetupkeyUpdate EventActivityCode = "setupkey.update"
|
||||
EventActivityCodeUserBlock EventActivityCode = "user.block"
|
||||
EventActivityCodeUserGroupAdd EventActivityCode = "user.group.add"
|
||||
EventActivityCodeUserGroupDelete EventActivityCode = "user.group.delete"
|
||||
EventActivityCodeUserInvite EventActivityCode = "user.invite"
|
||||
EventActivityCodeUserJoin EventActivityCode = "user.join"
|
||||
EventActivityCodeUserPeerAdd EventActivityCode = "user.peer.add"
|
||||
EventActivityCodeUserPeerDelete EventActivityCode = "user.peer.delete"
|
||||
EventActivityCodeUserPeerLogin EventActivityCode = "user.peer.login"
|
||||
EventActivityCodeUserRoleUpdate EventActivityCode = "user.role.update"
|
||||
EventActivityCodeUserUnblock EventActivityCode = "user.unblock"
|
||||
EventActivityCodeAccountCreate EventActivityCode = "account.create"
|
||||
EventActivityCodeAccountDelete EventActivityCode = "account.delete"
|
||||
EventActivityCodeAccountDnsDomainUpdate EventActivityCode = "account.dns.domain.update"
|
||||
EventActivityCodeAccountNetworkRangeUpdate EventActivityCode = "account.network.range.update"
|
||||
EventActivityCodeAccountPeerInactivityExpirationDisable EventActivityCode = "account.peer.inactivity.expiration.disable"
|
||||
EventActivityCodeAccountPeerInactivityExpirationEnable EventActivityCode = "account.peer.inactivity.expiration.enable"
|
||||
EventActivityCodeAccountPeerInactivityExpirationUpdate EventActivityCode = "account.peer.inactivity.expiration.update"
|
||||
EventActivityCodeAccountSettingGroupPropagationDisable EventActivityCode = "account.setting.group.propagation.disable"
|
||||
EventActivityCodeAccountSettingGroupPropagationEnable EventActivityCode = "account.setting.group.propagation.enable"
|
||||
EventActivityCodeAccountSettingLazyConnectionDisable EventActivityCode = "account.setting.lazy.connection.disable"
|
||||
EventActivityCodeAccountSettingLazyConnectionEnable EventActivityCode = "account.setting.lazy.connection.enable"
|
||||
EventActivityCodeAccountSettingPeerApprovalDisable EventActivityCode = "account.setting.peer.approval.disable"
|
||||
EventActivityCodeAccountSettingPeerApprovalEnable EventActivityCode = "account.setting.peer.approval.enable"
|
||||
EventActivityCodeAccountSettingPeerLoginExpirationDisable EventActivityCode = "account.setting.peer.login.expiration.disable"
|
||||
EventActivityCodeAccountSettingPeerLoginExpirationEnable EventActivityCode = "account.setting.peer.login.expiration.enable"
|
||||
EventActivityCodeAccountSettingPeerLoginExpirationUpdate EventActivityCode = "account.setting.peer.login.expiration.update"
|
||||
EventActivityCodeAccountSettingRoutingPeerDnsResolutionDisable EventActivityCode = "account.setting.routing.peer.dns.resolution.disable"
|
||||
EventActivityCodeAccountSettingRoutingPeerDnsResolutionEnable EventActivityCode = "account.setting.routing.peer.dns.resolution.enable"
|
||||
EventActivityCodeAccountSettingsAutoVersionUpdate EventActivityCode = "account.settings.auto.version.update"
|
||||
EventActivityCodeDashboardLogin EventActivityCode = "dashboard.login"
|
||||
EventActivityCodeDnsSettingDisabledManagementGroupAdd EventActivityCode = "dns.setting.disabled.management.group.add"
|
||||
EventActivityCodeDnsSettingDisabledManagementGroupDelete EventActivityCode = "dns.setting.disabled.management.group.delete"
|
||||
EventActivityCodeDnsZoneCreate EventActivityCode = "dns.zone.create"
|
||||
EventActivityCodeDnsZoneDelete EventActivityCode = "dns.zone.delete"
|
||||
EventActivityCodeDnsZoneRecordCreate EventActivityCode = "dns.zone.record.create"
|
||||
EventActivityCodeDnsZoneRecordDelete EventActivityCode = "dns.zone.record.delete"
|
||||
EventActivityCodeDnsZoneRecordUpdate EventActivityCode = "dns.zone.record.update"
|
||||
EventActivityCodeDnsZoneUpdate EventActivityCode = "dns.zone.update"
|
||||
EventActivityCodeGroupAdd EventActivityCode = "group.add"
|
||||
EventActivityCodeGroupDelete EventActivityCode = "group.delete"
|
||||
EventActivityCodeGroupUpdate EventActivityCode = "group.update"
|
||||
EventActivityCodeIdentityproviderCreate EventActivityCode = "identityprovider.create"
|
||||
EventActivityCodeIdentityproviderDelete EventActivityCode = "identityprovider.delete"
|
||||
EventActivityCodeIdentityproviderUpdate EventActivityCode = "identityprovider.update"
|
||||
EventActivityCodeIntegrationCreate EventActivityCode = "integration.create"
|
||||
EventActivityCodeIntegrationDelete EventActivityCode = "integration.delete"
|
||||
EventActivityCodeIntegrationUpdate EventActivityCode = "integration.update"
|
||||
EventActivityCodeNameserverGroupAdd EventActivityCode = "nameserver.group.add"
|
||||
EventActivityCodeNameserverGroupDelete EventActivityCode = "nameserver.group.delete"
|
||||
EventActivityCodeNameserverGroupUpdate EventActivityCode = "nameserver.group.update"
|
||||
EventActivityCodeNetworkCreate EventActivityCode = "network.create"
|
||||
EventActivityCodeNetworkDelete EventActivityCode = "network.delete"
|
||||
EventActivityCodeNetworkResourceCreate EventActivityCode = "network.resource.create"
|
||||
EventActivityCodeNetworkResourceDelete EventActivityCode = "network.resource.delete"
|
||||
EventActivityCodeNetworkResourceUpdate EventActivityCode = "network.resource.update"
|
||||
EventActivityCodeNetworkRouterCreate EventActivityCode = "network.router.create"
|
||||
EventActivityCodeNetworkRouterDelete EventActivityCode = "network.router.delete"
|
||||
EventActivityCodeNetworkRouterUpdate EventActivityCode = "network.router.update"
|
||||
EventActivityCodeNetworkUpdate EventActivityCode = "network.update"
|
||||
EventActivityCodePeerApprovalRevoke EventActivityCode = "peer.approval.revoke"
|
||||
EventActivityCodePeerApprove EventActivityCode = "peer.approve"
|
||||
EventActivityCodePeerGroupAdd EventActivityCode = "peer.group.add"
|
||||
EventActivityCodePeerGroupDelete EventActivityCode = "peer.group.delete"
|
||||
EventActivityCodePeerInactivityExpirationDisable EventActivityCode = "peer.inactivity.expiration.disable"
|
||||
EventActivityCodePeerInactivityExpirationEnable EventActivityCode = "peer.inactivity.expiration.enable"
|
||||
EventActivityCodePeerIpUpdate EventActivityCode = "peer.ip.update"
|
||||
EventActivityCodePeerJobCreate EventActivityCode = "peer.job.create"
|
||||
EventActivityCodePeerLoginExpirationDisable EventActivityCode = "peer.login.expiration.disable"
|
||||
EventActivityCodePeerLoginExpirationEnable EventActivityCode = "peer.login.expiration.enable"
|
||||
EventActivityCodePeerLoginExpire EventActivityCode = "peer.login.expire"
|
||||
EventActivityCodePeerRename EventActivityCode = "peer.rename"
|
||||
EventActivityCodePeerSetupkeyAdd EventActivityCode = "peer.setupkey.add"
|
||||
EventActivityCodePeerSshDisable EventActivityCode = "peer.ssh.disable"
|
||||
EventActivityCodePeerSshEnable EventActivityCode = "peer.ssh.enable"
|
||||
EventActivityCodePeerUserAdd EventActivityCode = "peer.user.add"
|
||||
EventActivityCodePersonalAccessTokenCreate EventActivityCode = "personal.access.token.create"
|
||||
EventActivityCodePersonalAccessTokenDelete EventActivityCode = "personal.access.token.delete"
|
||||
EventActivityCodePolicyAdd EventActivityCode = "policy.add"
|
||||
EventActivityCodePolicyDelete EventActivityCode = "policy.delete"
|
||||
EventActivityCodePolicyUpdate EventActivityCode = "policy.update"
|
||||
EventActivityCodePostureCheckCreate EventActivityCode = "posture.check.create"
|
||||
EventActivityCodePostureCheckDelete EventActivityCode = "posture.check.delete"
|
||||
EventActivityCodePostureCheckUpdate EventActivityCode = "posture.check.update"
|
||||
EventActivityCodeResourceGroupAdd EventActivityCode = "resource.group.add"
|
||||
EventActivityCodeResourceGroupDelete EventActivityCode = "resource.group.delete"
|
||||
EventActivityCodeRouteAdd EventActivityCode = "route.add"
|
||||
EventActivityCodeRouteDelete EventActivityCode = "route.delete"
|
||||
EventActivityCodeRouteUpdate EventActivityCode = "route.update"
|
||||
EventActivityCodeRuleAdd EventActivityCode = "rule.add"
|
||||
EventActivityCodeRuleDelete EventActivityCode = "rule.delete"
|
||||
EventActivityCodeRuleUpdate EventActivityCode = "rule.update"
|
||||
EventActivityCodeServiceUserCreate EventActivityCode = "service.user.create"
|
||||
EventActivityCodeServiceUserDelete EventActivityCode = "service.user.delete"
|
||||
EventActivityCodeSetupkeyAdd EventActivityCode = "setupkey.add"
|
||||
EventActivityCodeSetupkeyDelete EventActivityCode = "setupkey.delete"
|
||||
EventActivityCodeSetupkeyGroupAdd EventActivityCode = "setupkey.group.add"
|
||||
EventActivityCodeSetupkeyGroupDelete EventActivityCode = "setupkey.group.delete"
|
||||
EventActivityCodeSetupkeyOveruse EventActivityCode = "setupkey.overuse"
|
||||
EventActivityCodeSetupkeyRevoke EventActivityCode = "setupkey.revoke"
|
||||
EventActivityCodeSetupkeyUpdate EventActivityCode = "setupkey.update"
|
||||
EventActivityCodeTransferredOwnerRole EventActivityCode = "transferred.owner.role"
|
||||
EventActivityCodeUserApprove EventActivityCode = "user.approve"
|
||||
EventActivityCodeUserBlock EventActivityCode = "user.block"
|
||||
EventActivityCodeUserCreate EventActivityCode = "user.create"
|
||||
EventActivityCodeUserDelete EventActivityCode = "user.delete"
|
||||
EventActivityCodeUserGroupAdd EventActivityCode = "user.group.add"
|
||||
EventActivityCodeUserGroupDelete EventActivityCode = "user.group.delete"
|
||||
EventActivityCodeUserInvite EventActivityCode = "user.invite"
|
||||
EventActivityCodeUserInviteLinkAccept EventActivityCode = "user.invite.link.accept"
|
||||
EventActivityCodeUserInviteLinkCreate EventActivityCode = "user.invite.link.create"
|
||||
EventActivityCodeUserInviteLinkDelete EventActivityCode = "user.invite.link.delete"
|
||||
EventActivityCodeUserInviteLinkRegenerate EventActivityCode = "user.invite.link.regenerate"
|
||||
EventActivityCodeUserJoin EventActivityCode = "user.join"
|
||||
EventActivityCodeUserPasswordChange EventActivityCode = "user.password.change"
|
||||
EventActivityCodeUserPeerDelete EventActivityCode = "user.peer.delete"
|
||||
EventActivityCodeUserPeerLogin EventActivityCode = "user.peer.login"
|
||||
EventActivityCodeUserReject EventActivityCode = "user.reject"
|
||||
EventActivityCodeUserRoleUpdate EventActivityCode = "user.role.update"
|
||||
EventActivityCodeUserUnblock EventActivityCode = "user.unblock"
|
||||
)
|
||||
|
||||
// Defines values for GeoLocationCheckAction.
|
||||
@@ -125,6 +188,13 @@ const (
|
||||
IngressPortAllocationRequestPortRangeProtocolUdp IngressPortAllocationRequestPortRangeProtocol = "udp"
|
||||
)
|
||||
|
||||
// Defines values for JobResponseStatus.
|
||||
const (
|
||||
JobResponseStatusFailed JobResponseStatus = "failed"
|
||||
JobResponseStatusPending JobResponseStatus = "pending"
|
||||
JobResponseStatusSucceeded JobResponseStatus = "succeeded"
|
||||
)
|
||||
|
||||
// Defines values for NameserverNsType.
|
||||
const (
|
||||
NameserverNsTypeUdp NameserverNsType = "udp"
|
||||
@@ -196,26 +266,6 @@ const (
|
||||
ResourceTypeSubnet ResourceType = "subnet"
|
||||
)
|
||||
|
||||
// Defines values for ReverseProxyAuthConfigType.
|
||||
const (
|
||||
ReverseProxyAuthConfigTypeBearer ReverseProxyAuthConfigType = "bearer"
|
||||
ReverseProxyAuthConfigTypeLink ReverseProxyAuthConfigType = "link"
|
||||
ReverseProxyAuthConfigTypePassword ReverseProxyAuthConfigType = "password"
|
||||
ReverseProxyAuthConfigTypePin ReverseProxyAuthConfigType = "pin"
|
||||
)
|
||||
|
||||
// Defines values for ReverseProxyTargetProtocol.
|
||||
const (
|
||||
ReverseProxyTargetProtocolHttp ReverseProxyTargetProtocol = "http"
|
||||
ReverseProxyTargetProtocolHttps ReverseProxyTargetProtocol = "https"
|
||||
)
|
||||
|
||||
// Defines values for ReverseProxyTargetTargetType.
|
||||
const (
|
||||
ReverseProxyTargetTargetTypePeer ReverseProxyTargetTargetType = "peer"
|
||||
ReverseProxyTargetTargetTypeResource ReverseProxyTargetTargetType = "resource"
|
||||
)
|
||||
|
||||
// Defines values for UserStatus.
|
||||
const (
|
||||
UserStatusActive UserStatus = "active"
|
||||
@@ -223,6 +273,11 @@ const (
|
||||
UserStatusInvited UserStatus = "invited"
|
||||
)
|
||||
|
||||
// Defines values for WorkloadType.
|
||||
const (
|
||||
WorkloadTypeBundle WorkloadType = "bundle"
|
||||
)
|
||||
|
||||
// Defines values for GetApiEventsNetworkTrafficParamsType.
|
||||
const (
|
||||
GetApiEventsNetworkTrafficParamsTypeTYPEDROP GetApiEventsNetworkTrafficParamsType = "TYPE_DROP"
|
||||
@@ -391,13 +446,45 @@ type AvailablePorts struct {
|
||||
Udp int `json:"udp"`
|
||||
}
|
||||
|
||||
// BearerAuthConfig defines model for BearerAuthConfig.
|
||||
type BearerAuthConfig struct {
|
||||
// DistributionGroups List of group IDs that can use bearer auth
|
||||
DistributionGroups *[]string `json:"distribution_groups,omitempty"`
|
||||
// BundleParameters These parameters control what gets included in the bundle and how it is processed.
|
||||
type BundleParameters struct {
|
||||
// Anonymize Whether sensitive data should be anonymized in the bundle.
|
||||
Anonymize bool `json:"anonymize"`
|
||||
|
||||
// Enabled Whether bearer auth is enabled
|
||||
Enabled bool `json:"enabled"`
|
||||
// BundleFor Whether to generate a bundle for the given timeframe.
|
||||
BundleFor bool `json:"bundle_for"`
|
||||
|
||||
// BundleForTime Time period in minutes for which to generate the bundle.
|
||||
BundleForTime int `json:"bundle_for_time"`
|
||||
|
||||
// LogFileCount Maximum number of log files to include in the bundle.
|
||||
LogFileCount int `json:"log_file_count"`
|
||||
}
|
||||
|
||||
// BundleResult defines model for BundleResult.
|
||||
type BundleResult struct {
|
||||
UploadKey *string `json:"upload_key"`
|
||||
}
|
||||
|
||||
// BundleWorkloadRequest defines model for BundleWorkloadRequest.
|
||||
type BundleWorkloadRequest struct {
|
||||
// Parameters These parameters control what gets included in the bundle and how it is processed.
|
||||
Parameters BundleParameters `json:"parameters"`
|
||||
|
||||
// Type Identifies the type of workload the job will execute.
|
||||
// Currently only `"bundle"` is supported.
|
||||
Type WorkloadType `json:"type"`
|
||||
}
|
||||
|
||||
// BundleWorkloadResponse defines model for BundleWorkloadResponse.
|
||||
type BundleWorkloadResponse struct {
|
||||
// Parameters These parameters control what gets included in the bundle and how it is processed.
|
||||
Parameters BundleParameters `json:"parameters"`
|
||||
Result BundleResult `json:"result"`
|
||||
|
||||
// Type Identifies the type of workload the job will execute.
|
||||
// Currently only `"bundle"` is supported.
|
||||
Type WorkloadType `json:"type"`
|
||||
}
|
||||
|
||||
// Checks List of objects that perform the actual checks
|
||||
@@ -787,12 +874,40 @@ type InstanceStatus struct {
|
||||
SetupRequired bool `json:"setup_required"`
|
||||
}
|
||||
|
||||
// LinkAuthConfig defines model for LinkAuthConfig.
|
||||
type LinkAuthConfig struct {
|
||||
// Enabled Whether link auth is enabled
|
||||
Enabled bool `json:"enabled"`
|
||||
// InstanceVersionInfo Version information for NetBird components
|
||||
type InstanceVersionInfo struct {
|
||||
// DashboardAvailableVersion The latest available version of the dashboard (from GitHub releases)
|
||||
DashboardAvailableVersion *string `json:"dashboard_available_version,omitempty"`
|
||||
|
||||
// ManagementAvailableVersion The latest available version of the management server (from GitHub releases)
|
||||
ManagementAvailableVersion *string `json:"management_available_version,omitempty"`
|
||||
|
||||
// ManagementCurrentVersion The current running version of the management server
|
||||
ManagementCurrentVersion string `json:"management_current_version"`
|
||||
|
||||
// ManagementUpdateAvailable Indicates if a newer management version is available
|
||||
ManagementUpdateAvailable bool `json:"management_update_available"`
|
||||
}
|
||||
|
||||
// JobRequest defines model for JobRequest.
|
||||
type JobRequest struct {
|
||||
Workload WorkloadRequest `json:"workload"`
|
||||
}
|
||||
|
||||
// JobResponse defines model for JobResponse.
|
||||
type JobResponse struct {
|
||||
CompletedAt *time.Time `json:"completed_at"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
FailedReason *string `json:"failed_reason"`
|
||||
Id string `json:"id"`
|
||||
Status JobResponseStatus `json:"status"`
|
||||
TriggeredBy string `json:"triggered_by"`
|
||||
Workload WorkloadResponse `json:"workload"`
|
||||
}
|
||||
|
||||
// JobResponseStatus defines model for JobResponse.Status.
|
||||
type JobResponseStatus string
|
||||
|
||||
// Location Describe geographical location information
|
||||
type Location struct {
|
||||
// CityName Commonly used English name of the city
|
||||
@@ -1163,22 +1278,13 @@ type OSVersionCheck struct {
|
||||
Windows *MinKernelVersionCheck `json:"windows,omitempty"`
|
||||
}
|
||||
|
||||
// PINAuthConfig defines model for PINAuthConfig.
|
||||
type PINAuthConfig struct {
|
||||
// Enabled Whether PIN auth is enabled
|
||||
Enabled bool `json:"enabled"`
|
||||
// PasswordChangeRequest defines model for PasswordChangeRequest.
|
||||
type PasswordChangeRequest struct {
|
||||
// NewPassword The new password to set
|
||||
NewPassword string `json:"new_password"`
|
||||
|
||||
// Pin PIN value
|
||||
Pin string `json:"pin"`
|
||||
}
|
||||
|
||||
// PasswordAuthConfig defines model for PasswordAuthConfig.
|
||||
type PasswordAuthConfig struct {
|
||||
// Enabled Whether password auth is enabled
|
||||
Enabled bool `json:"enabled"`
|
||||
|
||||
// Password Auth password
|
||||
Password string `json:"password"`
|
||||
// OldPassword The current password
|
||||
OldPassword string `json:"old_password"`
|
||||
}
|
||||
|
||||
// Peer defines model for Peer.
|
||||
@@ -1742,87 +1848,6 @@ type Resource struct {
|
||||
// ResourceType defines model for ResourceType.
|
||||
type ResourceType string
|
||||
|
||||
// ReverseProxy defines model for ReverseProxy.
|
||||
type ReverseProxy struct {
|
||||
Auth ReverseProxyAuthConfig `json:"auth"`
|
||||
|
||||
// Domain Domain for the reverse proxy
|
||||
Domain string `json:"domain"`
|
||||
|
||||
// Enabled Whether the reverse proxy is enabled
|
||||
Enabled bool `json:"enabled"`
|
||||
|
||||
// Id Reverse proxy ID
|
||||
Id string `json:"id"`
|
||||
|
||||
// Name Reverse proxy name
|
||||
Name string `json:"name"`
|
||||
|
||||
// Targets List of target backends for this reverse proxy
|
||||
Targets []ReverseProxyTarget `json:"targets"`
|
||||
}
|
||||
|
||||
// ReverseProxyAuthConfig defines model for ReverseProxyAuthConfig.
|
||||
type ReverseProxyAuthConfig struct {
|
||||
BearerAuth *BearerAuthConfig `json:"bearer_auth,omitempty"`
|
||||
LinkAuth *LinkAuthConfig `json:"link_auth,omitempty"`
|
||||
PasswordAuth *PasswordAuthConfig `json:"password_auth,omitempty"`
|
||||
PinAuth *PINAuthConfig `json:"pin_auth,omitempty"`
|
||||
|
||||
// Type Authentication type
|
||||
Type ReverseProxyAuthConfigType `json:"type"`
|
||||
}
|
||||
|
||||
// ReverseProxyAuthConfigType Authentication type
|
||||
type ReverseProxyAuthConfigType string
|
||||
|
||||
// ReverseProxyRequest defines model for ReverseProxyRequest.
|
||||
type ReverseProxyRequest struct {
|
||||
Auth ReverseProxyAuthConfig `json:"auth"`
|
||||
|
||||
// Domain Domain for the reverse proxy
|
||||
Domain string `json:"domain"`
|
||||
|
||||
// Enabled Whether the reverse proxy is enabled
|
||||
Enabled bool `json:"enabled"`
|
||||
|
||||
// Name Reverse proxy name
|
||||
Name string `json:"name"`
|
||||
|
||||
// Targets List of target backends for this reverse proxy
|
||||
Targets []ReverseProxyTarget `json:"targets"`
|
||||
}
|
||||
|
||||
// ReverseProxyTarget defines model for ReverseProxyTarget.
|
||||
type ReverseProxyTarget struct {
|
||||
// Enabled Whether this target is enabled
|
||||
Enabled bool `json:"enabled"`
|
||||
|
||||
// Host Backend ip or domain for this target
|
||||
Host string `json:"host"`
|
||||
|
||||
// Path URL path prefix for this target
|
||||
Path *string `json:"path,omitempty"`
|
||||
|
||||
// Port Backend port for this target
|
||||
Port int `json:"port"`
|
||||
|
||||
// Protocol Protocol to use when connecting to the backend
|
||||
Protocol ReverseProxyTargetProtocol `json:"protocol"`
|
||||
|
||||
// TargetId Target ID
|
||||
TargetId string `json:"target_id"`
|
||||
|
||||
// TargetType Target type (e.g., "peer", "resource")
|
||||
TargetType ReverseProxyTargetTargetType `json:"target_type"`
|
||||
}
|
||||
|
||||
// ReverseProxyTargetProtocol Protocol to use when connecting to the backend
|
||||
type ReverseProxyTargetProtocol string
|
||||
|
||||
// ReverseProxyTargetTargetType Target type (e.g., "peer", "resource")
|
||||
type ReverseProxyTargetTargetType string
|
||||
|
||||
// Route defines model for Route.
|
||||
type Route struct {
|
||||
// AccessControlGroups Access control group identifier associated with route.
|
||||
@@ -2160,6 +2185,99 @@ type UserCreateRequest struct {
|
||||
Role string `json:"role"`
|
||||
}
|
||||
|
||||
// UserInvite A user invite
|
||||
type UserInvite struct {
|
||||
// AutoGroups Group IDs to auto-assign to peers registered by this user
|
||||
AutoGroups []string `json:"auto_groups"`
|
||||
|
||||
// CreatedAt Invite creation time
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
|
||||
// Email User's email address
|
||||
Email string `json:"email"`
|
||||
|
||||
// Expired Whether the invite has expired
|
||||
Expired bool `json:"expired"`
|
||||
|
||||
// ExpiresAt Invite expiration time
|
||||
ExpiresAt time.Time `json:"expires_at"`
|
||||
|
||||
// Id Invite ID
|
||||
Id string `json:"id"`
|
||||
|
||||
// InviteToken The invite link to be shared with the user. Only returned when the invite is created or regenerated.
|
||||
InviteToken *string `json:"invite_token,omitempty"`
|
||||
|
||||
// Name User's full name
|
||||
Name string `json:"name"`
|
||||
|
||||
// Role User's NetBird account role
|
||||
Role string `json:"role"`
|
||||
}
|
||||
|
||||
// UserInviteAcceptRequest Request to accept an invite and set password
|
||||
type UserInviteAcceptRequest struct {
|
||||
// Password The password the user wants to set. Must be at least 8 characters long and contain at least one uppercase letter, one digit, and one special character (any character that is not a letter or digit, including spaces).
|
||||
Password string `json:"password"`
|
||||
}
|
||||
|
||||
// UserInviteAcceptResponse Response after accepting an invite
|
||||
type UserInviteAcceptResponse struct {
|
||||
// Success Whether the invite was accepted successfully
|
||||
Success bool `json:"success"`
|
||||
}
|
||||
|
||||
// UserInviteCreateRequest Request to create a user invite link
|
||||
type UserInviteCreateRequest struct {
|
||||
// AutoGroups Group IDs to auto-assign to peers registered by this user
|
||||
AutoGroups []string `json:"auto_groups"`
|
||||
|
||||
// Email User's email address
|
||||
Email string `json:"email"`
|
||||
|
||||
// ExpiresIn Invite expiration time in seconds (default 72 hours)
|
||||
ExpiresIn *int `json:"expires_in,omitempty"`
|
||||
|
||||
// Name User's full name
|
||||
Name string `json:"name"`
|
||||
|
||||
// Role User's NetBird account role
|
||||
Role string `json:"role"`
|
||||
}
|
||||
|
||||
// UserInviteInfo Public information about an invite
|
||||
type UserInviteInfo struct {
|
||||
// Email User's email address
|
||||
Email string `json:"email"`
|
||||
|
||||
// ExpiresAt Invite expiration time
|
||||
ExpiresAt time.Time `json:"expires_at"`
|
||||
|
||||
// InvitedBy Name of the user who sent the invite
|
||||
InvitedBy string `json:"invited_by"`
|
||||
|
||||
// Name User's full name
|
||||
Name string `json:"name"`
|
||||
|
||||
// Valid Whether the invite is still valid (not expired)
|
||||
Valid bool `json:"valid"`
|
||||
}
|
||||
|
||||
// UserInviteRegenerateRequest Request to regenerate an invite link
|
||||
type UserInviteRegenerateRequest struct {
|
||||
// ExpiresIn Invite expiration time in seconds (default 72 hours)
|
||||
ExpiresIn *int `json:"expires_in,omitempty"`
|
||||
}
|
||||
|
||||
// UserInviteRegenerateResponse Response after regenerating an invite
|
||||
type UserInviteRegenerateResponse struct {
|
||||
// InviteExpiresAt New invite expiration time
|
||||
InviteExpiresAt time.Time `json:"invite_expires_at"`
|
||||
|
||||
// InviteToken The new invite token
|
||||
InviteToken string `json:"invite_token"`
|
||||
}
|
||||
|
||||
// UserPermissions defines model for UserPermissions.
|
||||
type UserPermissions struct {
|
||||
// IsRestricted Indicates whether this User's Peers view is restricted
|
||||
@@ -2179,6 +2297,20 @@ type UserRequest struct {
|
||||
Role string `json:"role"`
|
||||
}
|
||||
|
||||
// WorkloadRequest defines model for WorkloadRequest.
|
||||
type WorkloadRequest struct {
|
||||
union json.RawMessage
|
||||
}
|
||||
|
||||
// WorkloadResponse defines model for WorkloadResponse.
|
||||
type WorkloadResponse struct {
|
||||
union json.RawMessage
|
||||
}
|
||||
|
||||
// WorkloadType Identifies the type of workload the job will execute.
|
||||
// Currently only `"bundle"` is supported.
|
||||
type WorkloadType string
|
||||
|
||||
// Zone defines model for Zone.
|
||||
type Zone struct {
|
||||
// DistributionGroups Group IDs that defines groups of peers that will resolve this zone
|
||||
@@ -2362,6 +2494,9 @@ type PostApiPeersPeerIdIngressPortsJSONRequestBody = IngressPortAllocationReques
|
||||
// PutApiPeersPeerIdIngressPortsAllocationIdJSONRequestBody defines body for PutApiPeersPeerIdIngressPortsAllocationId for application/json ContentType.
|
||||
type PutApiPeersPeerIdIngressPortsAllocationIdJSONRequestBody = IngressPortAllocationRequest
|
||||
|
||||
// PostApiPeersPeerIdJobsJSONRequestBody defines body for PostApiPeersPeerIdJobs for application/json ContentType.
|
||||
type PostApiPeersPeerIdJobsJSONRequestBody = JobRequest
|
||||
|
||||
// PostApiPeersPeerIdTemporaryAccessJSONRequestBody defines body for PostApiPeersPeerIdTemporaryAccess for application/json ContentType.
|
||||
type PostApiPeersPeerIdTemporaryAccessJSONRequestBody = PeerTemporaryAccessRequest
|
||||
|
||||
@@ -2377,12 +2512,6 @@ type PostApiPostureChecksJSONRequestBody = PostureCheckUpdate
|
||||
// PutApiPostureChecksPostureCheckIdJSONRequestBody defines body for PutApiPostureChecksPostureCheckId for application/json ContentType.
|
||||
type PutApiPostureChecksPostureCheckIdJSONRequestBody = PostureCheckUpdate
|
||||
|
||||
// PostApiReverseProxyJSONRequestBody defines body for PostApiReverseProxy for application/json ContentType.
|
||||
type PostApiReverseProxyJSONRequestBody = ReverseProxyRequest
|
||||
|
||||
// PutApiReverseProxyProxyIdJSONRequestBody defines body for PutApiReverseProxyProxyId for application/json ContentType.
|
||||
type PutApiReverseProxyProxyIdJSONRequestBody = ReverseProxyRequest
|
||||
|
||||
// PostApiRoutesJSONRequestBody defines body for PostApiRoutes for application/json ContentType.
|
||||
type PostApiRoutesJSONRequestBody = RouteRequest
|
||||
|
||||
@@ -2401,8 +2530,138 @@ type PutApiSetupKeysKeyIdJSONRequestBody = SetupKeyRequest
|
||||
// PostApiUsersJSONRequestBody defines body for PostApiUsers for application/json ContentType.
|
||||
type PostApiUsersJSONRequestBody = UserCreateRequest
|
||||
|
||||
// PostApiUsersInvitesJSONRequestBody defines body for PostApiUsersInvites for application/json ContentType.
|
||||
type PostApiUsersInvitesJSONRequestBody = UserInviteCreateRequest
|
||||
|
||||
// PostApiUsersInvitesInviteIdRegenerateJSONRequestBody defines body for PostApiUsersInvitesInviteIdRegenerate for application/json ContentType.
|
||||
type PostApiUsersInvitesInviteIdRegenerateJSONRequestBody = UserInviteRegenerateRequest
|
||||
|
||||
// PostApiUsersInvitesTokenAcceptJSONRequestBody defines body for PostApiUsersInvitesTokenAccept for application/json ContentType.
|
||||
type PostApiUsersInvitesTokenAcceptJSONRequestBody = UserInviteAcceptRequest
|
||||
|
||||
// PutApiUsersUserIdJSONRequestBody defines body for PutApiUsersUserId for application/json ContentType.
|
||||
type PutApiUsersUserIdJSONRequestBody = UserRequest
|
||||
|
||||
// PutApiUsersUserIdPasswordJSONRequestBody defines body for PutApiUsersUserIdPassword for application/json ContentType.
|
||||
type PutApiUsersUserIdPasswordJSONRequestBody = PasswordChangeRequest
|
||||
|
||||
// PostApiUsersUserIdTokensJSONRequestBody defines body for PostApiUsersUserIdTokens for application/json ContentType.
|
||||
type PostApiUsersUserIdTokensJSONRequestBody = PersonalAccessTokenRequest
|
||||
|
||||
// AsBundleWorkloadRequest returns the union data inside the WorkloadRequest as a BundleWorkloadRequest
|
||||
func (t WorkloadRequest) AsBundleWorkloadRequest() (BundleWorkloadRequest, error) {
|
||||
var body BundleWorkloadRequest
|
||||
err := json.Unmarshal(t.union, &body)
|
||||
return body, err
|
||||
}
|
||||
|
||||
// FromBundleWorkloadRequest overwrites any union data inside the WorkloadRequest as the provided BundleWorkloadRequest
|
||||
func (t *WorkloadRequest) FromBundleWorkloadRequest(v BundleWorkloadRequest) error {
|
||||
v.Type = "bundle"
|
||||
b, err := json.Marshal(v)
|
||||
t.union = b
|
||||
return err
|
||||
}
|
||||
|
||||
// MergeBundleWorkloadRequest performs a merge with any union data inside the WorkloadRequest, using the provided BundleWorkloadRequest
|
||||
func (t *WorkloadRequest) MergeBundleWorkloadRequest(v BundleWorkloadRequest) error {
|
||||
v.Type = "bundle"
|
||||
b, err := json.Marshal(v)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
merged, err := runtime.JSONMerge(t.union, b)
|
||||
t.union = merged
|
||||
return err
|
||||
}
|
||||
|
||||
func (t WorkloadRequest) Discriminator() (string, error) {
|
||||
var discriminator struct {
|
||||
Discriminator string `json:"type"`
|
||||
}
|
||||
err := json.Unmarshal(t.union, &discriminator)
|
||||
return discriminator.Discriminator, err
|
||||
}
|
||||
|
||||
func (t WorkloadRequest) ValueByDiscriminator() (interface{}, error) {
|
||||
discriminator, err := t.Discriminator()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
switch discriminator {
|
||||
case "bundle":
|
||||
return t.AsBundleWorkloadRequest()
|
||||
default:
|
||||
return nil, errors.New("unknown discriminator value: " + discriminator)
|
||||
}
|
||||
}
|
||||
|
||||
func (t WorkloadRequest) MarshalJSON() ([]byte, error) {
|
||||
b, err := t.union.MarshalJSON()
|
||||
return b, err
|
||||
}
|
||||
|
||||
func (t *WorkloadRequest) UnmarshalJSON(b []byte) error {
|
||||
err := t.union.UnmarshalJSON(b)
|
||||
return err
|
||||
}
|
||||
|
||||
// AsBundleWorkloadResponse returns the union data inside the WorkloadResponse as a BundleWorkloadResponse
|
||||
func (t WorkloadResponse) AsBundleWorkloadResponse() (BundleWorkloadResponse, error) {
|
||||
var body BundleWorkloadResponse
|
||||
err := json.Unmarshal(t.union, &body)
|
||||
return body, err
|
||||
}
|
||||
|
||||
// FromBundleWorkloadResponse overwrites any union data inside the WorkloadResponse as the provided BundleWorkloadResponse
|
||||
func (t *WorkloadResponse) FromBundleWorkloadResponse(v BundleWorkloadResponse) error {
|
||||
v.Type = "bundle"
|
||||
b, err := json.Marshal(v)
|
||||
t.union = b
|
||||
return err
|
||||
}
|
||||
|
||||
// MergeBundleWorkloadResponse performs a merge with any union data inside the WorkloadResponse, using the provided BundleWorkloadResponse
|
||||
func (t *WorkloadResponse) MergeBundleWorkloadResponse(v BundleWorkloadResponse) error {
|
||||
v.Type = "bundle"
|
||||
b, err := json.Marshal(v)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
merged, err := runtime.JSONMerge(t.union, b)
|
||||
t.union = merged
|
||||
return err
|
||||
}
|
||||
|
||||
func (t WorkloadResponse) Discriminator() (string, error) {
|
||||
var discriminator struct {
|
||||
Discriminator string `json:"type"`
|
||||
}
|
||||
err := json.Unmarshal(t.union, &discriminator)
|
||||
return discriminator.Discriminator, err
|
||||
}
|
||||
|
||||
func (t WorkloadResponse) ValueByDiscriminator() (interface{}, error) {
|
||||
discriminator, err := t.Discriminator()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
switch discriminator {
|
||||
case "bundle":
|
||||
return t.AsBundleWorkloadResponse()
|
||||
default:
|
||||
return nil, errors.New("unknown discriminator value: " + discriminator)
|
||||
}
|
||||
}
|
||||
|
||||
func (t WorkloadResponse) MarshalJSON() ([]byte, error) {
|
||||
b, err := t.union.MarshalJSON()
|
||||
return b, err
|
||||
}
|
||||
|
||||
func (t *WorkloadResponse) UnmarshalJSON(b []byte) error {
|
||||
err := t.union.UnmarshalJSON(b)
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user