diff --git a/management.yml b/management.yml index 915b60b9..e0c0509d 100644 --- a/management.yml +++ b/management.yml @@ -3698,6 +3698,92 @@ paths: name: id in: path required: true + /configs/{id}/services: + get: + security: + - ztSession: [] + description: | + Retrieves a list of service resources that reference a given config; supports filtering, sorting, and pagination. Requires admin access. + tags: + - Config + summary: List services referenced by a config + operationId: listConfigServices + parameters: + - type: integer + name: limit + in: query + - type: integer + name: offset + in: query + - type: string + name: filter + in: query + responses: + "200": + description: A list of services + schema: + $ref: '#/definitions/listServicesEnvelope' + "400": + description: The requested resource does not exist + schema: + $ref: '#/definitions/apiErrorEnvelope' + examples: + application/json: + error: + args: + urlVars: + id: 71a3000f-7dda-491a-9b90-a19f4ee6c406 + cause: null + causeMessage: "" + code: NOT_FOUND + message: The resource requested was not found or is no longer available + requestId: 270908d6-f2ef-4577-b973-67bec18ae376 + meta: + apiEnrollmentVersion: 0.0.1 + apiVersion: 0.0.1 + "401": + description: The supplied session does not have the correct access rights + to request this resource + schema: + $ref: '#/definitions/apiErrorEnvelope' + examples: + application/json: + error: + args: + urlVars: {} + cause: "" + causeMessage: "" + code: UNAUTHORIZED + message: The request could not be completed. The session is not authorized + or the credentials are invalid + requestId: 0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f + meta: + apiEnrollmentVersion: 0.0.1 + apiVersion: 0.0.1 + "429": + description: The resource requested is rate limited and the rate limit has + been exceeded + schema: + $ref: '#/definitions/apiErrorEnvelope' + examples: + application/json: + error: + args: + urlVars: {} + causeMessage: you have hit a rate limit in the requested operation + code: RATE_LIMITED + message: The resource is rate limited and the rate limit has been + exceeded. Please try again later + requestId: 270908d6-f2ef-4577-b973-67bec18ae376 + meta: + apiEnrollmentVersion: 0.0.1 + apiVersion: 0.0.1 + parameters: + - type: string + description: The id of the requested resource + name: id + in: path + required: true /controllers: get: security: @@ -9965,6 +10051,99 @@ paths: name: id in: path required: true + /posture-check-role-attributes: + get: + security: + - ztSession: [] + - oauth2: + - openid + description: | + Retrieves a list of role attributes in use by posture checks; supports filtering, sorting, and pagination. Requires admin access. + tags: + - Role Attributes + summary: List role attributes in use by posture checks + operationId: listPostureCheckRoleAttributes + parameters: + - type: integer + name: limit + in: query + - type: integer + name: offset + in: query + - type: string + name: filter + in: query + responses: + "200": + description: A list of role attributes + schema: + $ref: '#/definitions/listRoleAttributesEnvelope' + "400": + description: The supplied request contains invalid fields or could not be + parsed (json and non-json bodies). The error's code, message, and cause + fields can be inspected for further information + schema: + $ref: '#/definitions/apiErrorEnvelope' + examples: + application/json: + error: + args: + urlVars: {} + cause: + details: + context: (root) + field: (root) + property: fooField3 + field: (root) + message: '(root): fooField3 is required' + type: required + value: + fooField: abc + fooField2: def + causeMessage: schema validation failed + code: COULD_NOT_VALIDATE + message: The supplied request contains an invalid document + requestId: ac6766d6-3a09-44b3-8d8a-1b541d97fdd9 + meta: + apiEnrollmentVersion: 0.0.1 + apiVersion: 0.0.1 + "401": + description: The supplied session does not have the correct access rights + to request this resource + schema: + $ref: '#/definitions/apiErrorEnvelope' + examples: + application/json: + error: + args: + urlVars: {} + cause: "" + causeMessage: "" + code: UNAUTHORIZED + message: The request could not be completed. The session is not authorized + or the credentials are invalid + requestId: 0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f + meta: + apiEnrollmentVersion: 0.0.1 + apiVersion: 0.0.1 + "429": + description: The resource requested is rate limited and the rate limit has + been exceeded + schema: + $ref: '#/definitions/apiErrorEnvelope' + examples: + application/json: + error: + args: + urlVars: {} + causeMessage: you have hit a rate limit in the requested operation + code: RATE_LIMITED + message: The resource is rate limited and the rate limit has been + exceeded. Please try again later + requestId: 270908d6-f2ef-4577-b973-67bec18ae376 + meta: + apiEnrollmentVersion: 0.0.1 + apiVersion: 0.0.1 /posture-check-types: get: security: diff --git a/rest_management_api_client/config/config_client.go b/rest_management_api_client/config/config_client.go index 378db895..38a29b11 100644 --- a/rest_management_api_client/config/config_client.go +++ b/rest_management_api_client/config/config_client.go @@ -66,6 +66,8 @@ type ClientService interface { DetailConfigType(params *DetailConfigTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailConfigTypeOK, error) + ListConfigServices(params *ListConfigServicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListConfigServicesOK, error) + ListConfigTypes(params *ListConfigTypesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListConfigTypesOK, error) ListConfigs(params *ListConfigsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListConfigsOK, error) @@ -327,6 +329,48 @@ func (a *Client) DetailConfigType(params *DetailConfigTypeParams, authInfo runti panic(msg) } +/* + ListConfigServices lists services referenced by a config + + Retrieves a list of service resources that reference a given config; supports filtering, sorting, and pagination. Requires admin access. + +*/ +func (a *Client) ListConfigServices(params *ListConfigServicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListConfigServicesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewListConfigServicesParams() + } + op := &runtime.ClientOperation{ + ID: "listConfigServices", + Method: "GET", + PathPattern: "/configs/{id}/services", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ListConfigServicesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ListConfigServicesOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for listConfigServices: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* ListConfigTypes lists config types diff --git a/rest_management_api_client/config/list_config_services_parameters.go b/rest_management_api_client/config/list_config_services_parameters.go new file mode 100644 index 00000000..8d106317 --- /dev/null +++ b/rest_management_api_client/config/list_config_services_parameters.go @@ -0,0 +1,267 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry Inc. +// +// 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 +// +// https://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. +// +// __ __ _ +// \ \ / / (_) +// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ +// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | +// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. +// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | +// __/ | +// |___/ + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListConfigServicesParams creates a new ListConfigServicesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListConfigServicesParams() *ListConfigServicesParams { + return &ListConfigServicesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListConfigServicesParamsWithTimeout creates a new ListConfigServicesParams object +// with the ability to set a timeout on a request. +func NewListConfigServicesParamsWithTimeout(timeout time.Duration) *ListConfigServicesParams { + return &ListConfigServicesParams{ + timeout: timeout, + } +} + +// NewListConfigServicesParamsWithContext creates a new ListConfigServicesParams object +// with the ability to set a context for a request. +func NewListConfigServicesParamsWithContext(ctx context.Context) *ListConfigServicesParams { + return &ListConfigServicesParams{ + Context: ctx, + } +} + +// NewListConfigServicesParamsWithHTTPClient creates a new ListConfigServicesParams object +// with the ability to set a custom HTTPClient for a request. +func NewListConfigServicesParamsWithHTTPClient(client *http.Client) *ListConfigServicesParams { + return &ListConfigServicesParams{ + HTTPClient: client, + } +} + +/* ListConfigServicesParams contains all the parameters to send to the API endpoint + for the list config services operation. + + Typically these are written to a http.Request. +*/ +type ListConfigServicesParams struct { + + // Filter. + Filter *string + + /* ID. + + The id of the requested resource + */ + ID string + + // Limit. + Limit *int64 + + // Offset. + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list config services params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListConfigServicesParams) WithDefaults() *ListConfigServicesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list config services params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListConfigServicesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list config services params +func (o *ListConfigServicesParams) WithTimeout(timeout time.Duration) *ListConfigServicesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list config services params +func (o *ListConfigServicesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list config services params +func (o *ListConfigServicesParams) WithContext(ctx context.Context) *ListConfigServicesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list config services params +func (o *ListConfigServicesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list config services params +func (o *ListConfigServicesParams) WithHTTPClient(client *http.Client) *ListConfigServicesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list config services params +func (o *ListConfigServicesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFilter adds the filter to the list config services params +func (o *ListConfigServicesParams) WithFilter(filter *string) *ListConfigServicesParams { + o.SetFilter(filter) + return o +} + +// SetFilter adds the filter to the list config services params +func (o *ListConfigServicesParams) SetFilter(filter *string) { + o.Filter = filter +} + +// WithID adds the id to the list config services params +func (o *ListConfigServicesParams) WithID(id string) *ListConfigServicesParams { + o.SetID(id) + return o +} + +// SetID adds the id to the list config services params +func (o *ListConfigServicesParams) SetID(id string) { + o.ID = id +} + +// WithLimit adds the limit to the list config services params +func (o *ListConfigServicesParams) WithLimit(limit *int64) *ListConfigServicesParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the list config services params +func (o *ListConfigServicesParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the list config services params +func (o *ListConfigServicesParams) WithOffset(offset *int64) *ListConfigServicesParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the list config services params +func (o *ListConfigServicesParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *ListConfigServicesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Filter != nil { + + // query param filter + var qrFilter string + + if o.Filter != nil { + qrFilter = *o.Filter + } + qFilter := qrFilter + if qFilter != "" { + + if err := r.SetQueryParam("filter", qFilter); err != nil { + return err + } + } + } + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/rest_management_api_client/config/list_config_services_responses.go b/rest_management_api_client/config/list_config_services_responses.go new file mode 100644 index 00000000..7425ae6d --- /dev/null +++ b/rest_management_api_client/config/list_config_services_responses.go @@ -0,0 +1,205 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry Inc. +// +// 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 +// +// https://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. +// +// __ __ _ +// \ \ / / (_) +// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ +// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | +// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. +// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | +// __/ | +// |___/ + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/openziti/edge-api/rest_model" +) + +// ListConfigServicesReader is a Reader for the ListConfigServices structure. +type ListConfigServicesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListConfigServicesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListConfigServicesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewListConfigServicesBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewListConfigServicesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewListConfigServicesTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListConfigServicesOK creates a ListConfigServicesOK with default headers values +func NewListConfigServicesOK() *ListConfigServicesOK { + return &ListConfigServicesOK{} +} + +/* ListConfigServicesOK describes a response with status code 200, with default header values. + +A list of services +*/ +type ListConfigServicesOK struct { + Payload *rest_model.ListServicesEnvelope +} + +func (o *ListConfigServicesOK) Error() string { + return fmt.Sprintf("[GET /configs/{id}/services][%d] listConfigServicesOK %+v", 200, o.Payload) +} +func (o *ListConfigServicesOK) GetPayload() *rest_model.ListServicesEnvelope { + return o.Payload +} + +func (o *ListConfigServicesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(rest_model.ListServicesEnvelope) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewListConfigServicesBadRequest creates a ListConfigServicesBadRequest with default headers values +func NewListConfigServicesBadRequest() *ListConfigServicesBadRequest { + return &ListConfigServicesBadRequest{} +} + +/* ListConfigServicesBadRequest describes a response with status code 400, with default header values. + +The requested resource does not exist +*/ +type ListConfigServicesBadRequest struct { + Payload *rest_model.APIErrorEnvelope +} + +func (o *ListConfigServicesBadRequest) Error() string { + return fmt.Sprintf("[GET /configs/{id}/services][%d] listConfigServicesBadRequest %+v", 400, o.Payload) +} +func (o *ListConfigServicesBadRequest) GetPayload() *rest_model.APIErrorEnvelope { + return o.Payload +} + +func (o *ListConfigServicesBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(rest_model.APIErrorEnvelope) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewListConfigServicesUnauthorized creates a ListConfigServicesUnauthorized with default headers values +func NewListConfigServicesUnauthorized() *ListConfigServicesUnauthorized { + return &ListConfigServicesUnauthorized{} +} + +/* ListConfigServicesUnauthorized describes a response with status code 401, with default header values. + +The supplied session does not have the correct access rights to request this resource +*/ +type ListConfigServicesUnauthorized struct { + Payload *rest_model.APIErrorEnvelope +} + +func (o *ListConfigServicesUnauthorized) Error() string { + return fmt.Sprintf("[GET /configs/{id}/services][%d] listConfigServicesUnauthorized %+v", 401, o.Payload) +} +func (o *ListConfigServicesUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { + return o.Payload +} + +func (o *ListConfigServicesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(rest_model.APIErrorEnvelope) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewListConfigServicesTooManyRequests creates a ListConfigServicesTooManyRequests with default headers values +func NewListConfigServicesTooManyRequests() *ListConfigServicesTooManyRequests { + return &ListConfigServicesTooManyRequests{} +} + +/* ListConfigServicesTooManyRequests describes a response with status code 429, with default header values. + +The resource requested is rate limited and the rate limit has been exceeded +*/ +type ListConfigServicesTooManyRequests struct { + Payload *rest_model.APIErrorEnvelope +} + +func (o *ListConfigServicesTooManyRequests) Error() string { + return fmt.Sprintf("[GET /configs/{id}/services][%d] listConfigServicesTooManyRequests %+v", 429, o.Payload) +} +func (o *ListConfigServicesTooManyRequests) GetPayload() *rest_model.APIErrorEnvelope { + return o.Payload +} + +func (o *ListConfigServicesTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(rest_model.APIErrorEnvelope) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/rest_management_api_client/role_attributes/list_posture_check_role_attributes_parameters.go b/rest_management_api_client/role_attributes/list_posture_check_role_attributes_parameters.go new file mode 100644 index 00000000..16916585 --- /dev/null +++ b/rest_management_api_client/role_attributes/list_posture_check_role_attributes_parameters.go @@ -0,0 +1,245 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry Inc. +// +// 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 +// +// https://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. +// +// __ __ _ +// \ \ / / (_) +// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ +// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | +// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. +// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | +// __/ | +// |___/ + +package role_attributes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListPostureCheckRoleAttributesParams creates a new ListPostureCheckRoleAttributesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListPostureCheckRoleAttributesParams() *ListPostureCheckRoleAttributesParams { + return &ListPostureCheckRoleAttributesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListPostureCheckRoleAttributesParamsWithTimeout creates a new ListPostureCheckRoleAttributesParams object +// with the ability to set a timeout on a request. +func NewListPostureCheckRoleAttributesParamsWithTimeout(timeout time.Duration) *ListPostureCheckRoleAttributesParams { + return &ListPostureCheckRoleAttributesParams{ + timeout: timeout, + } +} + +// NewListPostureCheckRoleAttributesParamsWithContext creates a new ListPostureCheckRoleAttributesParams object +// with the ability to set a context for a request. +func NewListPostureCheckRoleAttributesParamsWithContext(ctx context.Context) *ListPostureCheckRoleAttributesParams { + return &ListPostureCheckRoleAttributesParams{ + Context: ctx, + } +} + +// NewListPostureCheckRoleAttributesParamsWithHTTPClient creates a new ListPostureCheckRoleAttributesParams object +// with the ability to set a custom HTTPClient for a request. +func NewListPostureCheckRoleAttributesParamsWithHTTPClient(client *http.Client) *ListPostureCheckRoleAttributesParams { + return &ListPostureCheckRoleAttributesParams{ + HTTPClient: client, + } +} + +/* ListPostureCheckRoleAttributesParams contains all the parameters to send to the API endpoint + for the list posture check role attributes operation. + + Typically these are written to a http.Request. +*/ +type ListPostureCheckRoleAttributesParams struct { + + // Filter. + Filter *string + + // Limit. + Limit *int64 + + // Offset. + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list posture check role attributes params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListPostureCheckRoleAttributesParams) WithDefaults() *ListPostureCheckRoleAttributesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list posture check role attributes params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListPostureCheckRoleAttributesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list posture check role attributes params +func (o *ListPostureCheckRoleAttributesParams) WithTimeout(timeout time.Duration) *ListPostureCheckRoleAttributesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list posture check role attributes params +func (o *ListPostureCheckRoleAttributesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list posture check role attributes params +func (o *ListPostureCheckRoleAttributesParams) WithContext(ctx context.Context) *ListPostureCheckRoleAttributesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list posture check role attributes params +func (o *ListPostureCheckRoleAttributesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list posture check role attributes params +func (o *ListPostureCheckRoleAttributesParams) WithHTTPClient(client *http.Client) *ListPostureCheckRoleAttributesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list posture check role attributes params +func (o *ListPostureCheckRoleAttributesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFilter adds the filter to the list posture check role attributes params +func (o *ListPostureCheckRoleAttributesParams) WithFilter(filter *string) *ListPostureCheckRoleAttributesParams { + o.SetFilter(filter) + return o +} + +// SetFilter adds the filter to the list posture check role attributes params +func (o *ListPostureCheckRoleAttributesParams) SetFilter(filter *string) { + o.Filter = filter +} + +// WithLimit adds the limit to the list posture check role attributes params +func (o *ListPostureCheckRoleAttributesParams) WithLimit(limit *int64) *ListPostureCheckRoleAttributesParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the list posture check role attributes params +func (o *ListPostureCheckRoleAttributesParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the list posture check role attributes params +func (o *ListPostureCheckRoleAttributesParams) WithOffset(offset *int64) *ListPostureCheckRoleAttributesParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the list posture check role attributes params +func (o *ListPostureCheckRoleAttributesParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *ListPostureCheckRoleAttributesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Filter != nil { + + // query param filter + var qrFilter string + + if o.Filter != nil { + qrFilter = *o.Filter + } + qFilter := qrFilter + if qFilter != "" { + + if err := r.SetQueryParam("filter", qFilter); err != nil { + return err + } + } + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/rest_management_api_client/role_attributes/list_posture_check_role_attributes_responses.go b/rest_management_api_client/role_attributes/list_posture_check_role_attributes_responses.go new file mode 100644 index 00000000..87aa409e --- /dev/null +++ b/rest_management_api_client/role_attributes/list_posture_check_role_attributes_responses.go @@ -0,0 +1,205 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry Inc. +// +// 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 +// +// https://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. +// +// __ __ _ +// \ \ / / (_) +// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ +// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | +// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. +// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | +// __/ | +// |___/ + +package role_attributes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/openziti/edge-api/rest_model" +) + +// ListPostureCheckRoleAttributesReader is a Reader for the ListPostureCheckRoleAttributes structure. +type ListPostureCheckRoleAttributesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListPostureCheckRoleAttributesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListPostureCheckRoleAttributesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewListPostureCheckRoleAttributesBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewListPostureCheckRoleAttributesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewListPostureCheckRoleAttributesTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListPostureCheckRoleAttributesOK creates a ListPostureCheckRoleAttributesOK with default headers values +func NewListPostureCheckRoleAttributesOK() *ListPostureCheckRoleAttributesOK { + return &ListPostureCheckRoleAttributesOK{} +} + +/* ListPostureCheckRoleAttributesOK describes a response with status code 200, with default header values. + +A list of role attributes +*/ +type ListPostureCheckRoleAttributesOK struct { + Payload *rest_model.ListRoleAttributesEnvelope +} + +func (o *ListPostureCheckRoleAttributesOK) Error() string { + return fmt.Sprintf("[GET /posture-check-role-attributes][%d] listPostureCheckRoleAttributesOK %+v", 200, o.Payload) +} +func (o *ListPostureCheckRoleAttributesOK) GetPayload() *rest_model.ListRoleAttributesEnvelope { + return o.Payload +} + +func (o *ListPostureCheckRoleAttributesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(rest_model.ListRoleAttributesEnvelope) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewListPostureCheckRoleAttributesBadRequest creates a ListPostureCheckRoleAttributesBadRequest with default headers values +func NewListPostureCheckRoleAttributesBadRequest() *ListPostureCheckRoleAttributesBadRequest { + return &ListPostureCheckRoleAttributesBadRequest{} +} + +/* ListPostureCheckRoleAttributesBadRequest describes a response with status code 400, with default header values. + +The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information +*/ +type ListPostureCheckRoleAttributesBadRequest struct { + Payload *rest_model.APIErrorEnvelope +} + +func (o *ListPostureCheckRoleAttributesBadRequest) Error() string { + return fmt.Sprintf("[GET /posture-check-role-attributes][%d] listPostureCheckRoleAttributesBadRequest %+v", 400, o.Payload) +} +func (o *ListPostureCheckRoleAttributesBadRequest) GetPayload() *rest_model.APIErrorEnvelope { + return o.Payload +} + +func (o *ListPostureCheckRoleAttributesBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(rest_model.APIErrorEnvelope) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewListPostureCheckRoleAttributesUnauthorized creates a ListPostureCheckRoleAttributesUnauthorized with default headers values +func NewListPostureCheckRoleAttributesUnauthorized() *ListPostureCheckRoleAttributesUnauthorized { + return &ListPostureCheckRoleAttributesUnauthorized{} +} + +/* ListPostureCheckRoleAttributesUnauthorized describes a response with status code 401, with default header values. + +The supplied session does not have the correct access rights to request this resource +*/ +type ListPostureCheckRoleAttributesUnauthorized struct { + Payload *rest_model.APIErrorEnvelope +} + +func (o *ListPostureCheckRoleAttributesUnauthorized) Error() string { + return fmt.Sprintf("[GET /posture-check-role-attributes][%d] listPostureCheckRoleAttributesUnauthorized %+v", 401, o.Payload) +} +func (o *ListPostureCheckRoleAttributesUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { + return o.Payload +} + +func (o *ListPostureCheckRoleAttributesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(rest_model.APIErrorEnvelope) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewListPostureCheckRoleAttributesTooManyRequests creates a ListPostureCheckRoleAttributesTooManyRequests with default headers values +func NewListPostureCheckRoleAttributesTooManyRequests() *ListPostureCheckRoleAttributesTooManyRequests { + return &ListPostureCheckRoleAttributesTooManyRequests{} +} + +/* ListPostureCheckRoleAttributesTooManyRequests describes a response with status code 429, with default header values. + +The resource requested is rate limited and the rate limit has been exceeded +*/ +type ListPostureCheckRoleAttributesTooManyRequests struct { + Payload *rest_model.APIErrorEnvelope +} + +func (o *ListPostureCheckRoleAttributesTooManyRequests) Error() string { + return fmt.Sprintf("[GET /posture-check-role-attributes][%d] listPostureCheckRoleAttributesTooManyRequests %+v", 429, o.Payload) +} +func (o *ListPostureCheckRoleAttributesTooManyRequests) GetPayload() *rest_model.APIErrorEnvelope { + return o.Payload +} + +func (o *ListPostureCheckRoleAttributesTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(rest_model.APIErrorEnvelope) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/rest_management_api_client/role_attributes/role_attributes_client.go b/rest_management_api_client/role_attributes/role_attributes_client.go index 817d4f1a..646b73f4 100644 --- a/rest_management_api_client/role_attributes/role_attributes_client.go +++ b/rest_management_api_client/role_attributes/role_attributes_client.go @@ -58,6 +58,8 @@ type ClientService interface { ListIdentityRoleAttributes(params *ListIdentityRoleAttributesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIdentityRoleAttributesOK, error) + ListPostureCheckRoleAttributes(params *ListPostureCheckRoleAttributesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListPostureCheckRoleAttributesOK, error) + ListServiceRoleAttributes(params *ListServiceRoleAttributesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServiceRoleAttributesOK, error) SetTransport(transport runtime.ClientTransport) @@ -147,6 +149,48 @@ func (a *Client) ListIdentityRoleAttributes(params *ListIdentityRoleAttributesPa panic(msg) } +/* + ListPostureCheckRoleAttributes lists role attributes in use by posture checks + + Retrieves a list of role attributes in use by posture checks; supports filtering, sorting, and pagination. Requires admin access. + +*/ +func (a *Client) ListPostureCheckRoleAttributes(params *ListPostureCheckRoleAttributesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListPostureCheckRoleAttributesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewListPostureCheckRoleAttributesParams() + } + op := &runtime.ClientOperation{ + ID: "listPostureCheckRoleAttributes", + Method: "GET", + PathPattern: "/posture-check-role-attributes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ListPostureCheckRoleAttributesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ListPostureCheckRoleAttributesOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for listPostureCheckRoleAttributes: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* ListServiceRoleAttributes lists role attributes in use by services diff --git a/rest_management_api_server/configure_ziti_edge_management.go b/rest_management_api_server/configure_ziti_edge_management.go index 576175ac..060e8b0e 100644 --- a/rest_management_api_server/configure_ziti_edge_management.go +++ b/rest_management_api_server/configure_ziti_edge_management.go @@ -576,6 +576,11 @@ func configureAPI(api *operations.ZitiEdgeManagementAPI) http.Handler { return middleware.NotImplemented("operation certificate_authority.ListCas has not yet been implemented") }) } + if api.ConfigListConfigServicesHandler == nil { + api.ConfigListConfigServicesHandler = config.ListConfigServicesHandlerFunc(func(params config.ListConfigServicesParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation config.ListConfigServices has not yet been implemented") + }) + } if api.ConfigListConfigTypesHandler == nil { api.ConfigListConfigTypesHandler = config.ListConfigTypesHandlerFunc(func(params config.ListConfigTypesParams, principal interface{}) middleware.Responder { return middleware.NotImplemented("operation config.ListConfigTypes has not yet been implemented") @@ -701,6 +706,11 @@ func configureAPI(api *operations.ZitiEdgeManagementAPI) http.Handler { return middleware.NotImplemented("operation identity.ListIdentitysServiceConfigs has not yet been implemented") }) } + if api.RoleAttributesListPostureCheckRoleAttributesHandler == nil { + api.RoleAttributesListPostureCheckRoleAttributesHandler = role_attributes.ListPostureCheckRoleAttributesHandlerFunc(func(params role_attributes.ListPostureCheckRoleAttributesParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation role_attributes.ListPostureCheckRoleAttributes has not yet been implemented") + }) + } if api.PostureChecksListPostureCheckTypesHandler == nil { api.PostureChecksListPostureCheckTypesHandler = posture_checks.ListPostureCheckTypesHandlerFunc(func(params posture_checks.ListPostureCheckTypesParams, principal interface{}) middleware.Responder { return middleware.NotImplemented("operation posture_checks.ListPostureCheckTypes has not yet been implemented") diff --git a/rest_management_api_server/embedded_spec.go b/rest_management_api_server/embedded_spec.go index 5d94c0b8..c200c5dd 100644 --- a/rest_management_api_server/embedded_spec.go +++ b/rest_management_api_server/embedded_spec.go @@ -5001,6 +5001,128 @@ func init() { } ] }, + "/configs/{id}/services": { + "get": { + "security": [ + { + "ztSession": [] + } + ], + "description": "Retrieves a list of service resources that reference a given config; supports filtering, sorting, and pagination. Requires admin access.\n", + "tags": [ + "Config" + ], + "summary": "List services referenced by a config", + "operationId": "listConfigServices", + "parameters": [ + { + "type": "integer", + "name": "limit", + "in": "query" + }, + { + "type": "integer", + "name": "offset", + "in": "query" + }, + { + "type": "string", + "name": "filter", + "in": "query" + } + ], + "responses": { + "200": { + "description": "A list of services", + "schema": { + "$ref": "#/definitions/listServicesEnvelope" + } + }, + "400": { + "description": "The requested resource does not exist", + "schema": { + "$ref": "#/definitions/apiErrorEnvelope" + }, + "examples": { + "application/json": { + "error": { + "args": { + "urlVars": { + "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" + } + }, + "cause": null, + "causeMessage": "", + "code": "NOT_FOUND", + "message": "The resource requested was not found or is no longer available", + "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" + }, + "meta": { + "apiEnrollmentVersion": "0.0.1", + "apiVersion": "0.0.1" + } + } + } + }, + "401": { + "description": "The supplied session does not have the correct access rights to request this resource", + "schema": { + "$ref": "#/definitions/apiErrorEnvelope" + }, + "examples": { + "application/json": { + "error": { + "args": { + "urlVars": {} + }, + "cause": "", + "causeMessage": "", + "code": "UNAUTHORIZED", + "message": "The request could not be completed. The session is not authorized or the credentials are invalid", + "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" + }, + "meta": { + "apiEnrollmentVersion": "0.0.1", + "apiVersion": "0.0.1" + } + } + } + }, + "429": { + "description": "The resource requested is rate limited and the rate limit has been exceeded", + "schema": { + "$ref": "#/definitions/apiErrorEnvelope" + }, + "examples": { + "application/json": { + "error": { + "args": { + "urlVars": {} + }, + "causeMessage": "you have hit a rate limit in the requested operation", + "code": "RATE_LIMITED", + "message": "The resource is rate limited and the rate limit has been exceeded. Please try again later", + "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" + }, + "meta": { + "apiEnrollmentVersion": "0.0.1", + "apiVersion": "0.0.1" + } + } + } + } + } + }, + "parameters": [ + { + "type": "string", + "description": "The id of the requested resource", + "name": "id", + "in": "path", + "required": true + } + ] + }, "/controllers": { "get": { "security": [ @@ -13678,6 +13800,135 @@ func init() { } ] }, + "/posture-check-role-attributes": { + "get": { + "security": [ + { + "ztSession": [] + }, + { + "oauth2": [ + "openid" + ] + } + ], + "description": "Retrieves a list of role attributes in use by posture checks; supports filtering, sorting, and pagination. Requires admin access.\n", + "tags": [ + "Role Attributes" + ], + "summary": "List role attributes in use by posture checks", + "operationId": "listPostureCheckRoleAttributes", + "parameters": [ + { + "type": "integer", + "name": "limit", + "in": "query" + }, + { + "type": "integer", + "name": "offset", + "in": "query" + }, + { + "type": "string", + "name": "filter", + "in": "query" + } + ], + "responses": { + "200": { + "description": "A list of role attributes", + "schema": { + "$ref": "#/definitions/listRoleAttributesEnvelope" + } + }, + "400": { + "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", + "schema": { + "$ref": "#/definitions/apiErrorEnvelope" + }, + "examples": { + "application/json": { + "error": { + "args": { + "urlVars": {} + }, + "cause": { + "details": { + "context": "(root)", + "field": "(root)", + "property": "fooField3" + }, + "field": "(root)", + "message": "(root): fooField3 is required", + "type": "required", + "value": { + "fooField": "abc", + "fooField2": "def" + } + }, + "causeMessage": "schema validation failed", + "code": "COULD_NOT_VALIDATE", + "message": "The supplied request contains an invalid document", + "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" + }, + "meta": { + "apiEnrollmentVersion": "0.0.1", + "apiVersion": "0.0.1" + } + } + } + }, + "401": { + "description": "The supplied session does not have the correct access rights to request this resource", + "schema": { + "$ref": "#/definitions/apiErrorEnvelope" + }, + "examples": { + "application/json": { + "error": { + "args": { + "urlVars": {} + }, + "cause": "", + "causeMessage": "", + "code": "UNAUTHORIZED", + "message": "The request could not be completed. The session is not authorized or the credentials are invalid", + "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" + }, + "meta": { + "apiEnrollmentVersion": "0.0.1", + "apiVersion": "0.0.1" + } + } + } + }, + "429": { + "description": "The resource requested is rate limited and the rate limit has been exceeded", + "schema": { + "$ref": "#/definitions/apiErrorEnvelope" + }, + "examples": { + "application/json": { + "error": { + "args": { + "urlVars": {} + }, + "causeMessage": "you have hit a rate limit in the requested operation", + "code": "RATE_LIMITED", + "message": "The resource is rate limited and the rate limit has been exceeded. Please try again later", + "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" + }, + "meta": { + "apiEnrollmentVersion": "0.0.1", + "apiVersion": "0.0.1" + } + } + } + } + } + } + }, "/posture-check-types": { "get": { "security": [ @@ -32963,6 +33214,128 @@ func init() { } ] }, + "/configs/{id}/services": { + "get": { + "security": [ + { + "ztSession": [] + } + ], + "description": "Retrieves a list of service resources that reference a given config; supports filtering, sorting, and pagination. Requires admin access.\n", + "tags": [ + "Config" + ], + "summary": "List services referenced by a config", + "operationId": "listConfigServices", + "parameters": [ + { + "type": "integer", + "name": "limit", + "in": "query" + }, + { + "type": "integer", + "name": "offset", + "in": "query" + }, + { + "type": "string", + "name": "filter", + "in": "query" + } + ], + "responses": { + "200": { + "description": "A list of services", + "schema": { + "$ref": "#/definitions/listServicesEnvelope" + } + }, + "400": { + "description": "The requested resource does not exist", + "schema": { + "$ref": "#/definitions/apiErrorEnvelope" + }, + "examples": { + "application/json": { + "error": { + "args": { + "urlVars": { + "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" + } + }, + "cause": null, + "causeMessage": "", + "code": "NOT_FOUND", + "message": "The resource requested was not found or is no longer available", + "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" + }, + "meta": { + "apiEnrollmentVersion": "0.0.1", + "apiVersion": "0.0.1" + } + } + } + }, + "401": { + "description": "The supplied session does not have the correct access rights to request this resource", + "schema": { + "$ref": "#/definitions/apiErrorEnvelope" + }, + "examples": { + "application/json": { + "error": { + "args": { + "urlVars": {} + }, + "cause": "", + "causeMessage": "", + "code": "UNAUTHORIZED", + "message": "The request could not be completed. The session is not authorized or the credentials are invalid", + "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" + }, + "meta": { + "apiEnrollmentVersion": "0.0.1", + "apiVersion": "0.0.1" + } + } + } + }, + "429": { + "description": "The resource requested is rate limited and the rate limit has been exceeded", + "schema": { + "$ref": "#/definitions/apiErrorEnvelope" + }, + "examples": { + "application/json": { + "error": { + "args": { + "urlVars": {} + }, + "causeMessage": "you have hit a rate limit in the requested operation", + "code": "RATE_LIMITED", + "message": "The resource is rate limited and the rate limit has been exceeded. Please try again later", + "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" + }, + "meta": { + "apiEnrollmentVersion": "0.0.1", + "apiVersion": "0.0.1" + } + } + } + } + } + }, + "parameters": [ + { + "type": "string", + "description": "The id of the requested resource", + "name": "id", + "in": "path", + "required": true + } + ] + }, "/controllers": { "get": { "security": [ @@ -41640,6 +42013,135 @@ func init() { } ] }, + "/posture-check-role-attributes": { + "get": { + "security": [ + { + "ztSession": [] + }, + { + "oauth2": [ + "openid" + ] + } + ], + "description": "Retrieves a list of role attributes in use by posture checks; supports filtering, sorting, and pagination. Requires admin access.\n", + "tags": [ + "Role Attributes" + ], + "summary": "List role attributes in use by posture checks", + "operationId": "listPostureCheckRoleAttributes", + "parameters": [ + { + "type": "integer", + "name": "limit", + "in": "query" + }, + { + "type": "integer", + "name": "offset", + "in": "query" + }, + { + "type": "string", + "name": "filter", + "in": "query" + } + ], + "responses": { + "200": { + "description": "A list of role attributes", + "schema": { + "$ref": "#/definitions/listRoleAttributesEnvelope" + } + }, + "400": { + "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", + "schema": { + "$ref": "#/definitions/apiErrorEnvelope" + }, + "examples": { + "application/json": { + "error": { + "args": { + "urlVars": {} + }, + "cause": { + "details": { + "context": "(root)", + "field": "(root)", + "property": "fooField3" + }, + "field": "(root)", + "message": "(root): fooField3 is required", + "type": "required", + "value": { + "fooField": "abc", + "fooField2": "def" + } + }, + "causeMessage": "schema validation failed", + "code": "COULD_NOT_VALIDATE", + "message": "The supplied request contains an invalid document", + "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" + }, + "meta": { + "apiEnrollmentVersion": "0.0.1", + "apiVersion": "0.0.1" + } + } + } + }, + "401": { + "description": "The supplied session does not have the correct access rights to request this resource", + "schema": { + "$ref": "#/definitions/apiErrorEnvelope" + }, + "examples": { + "application/json": { + "error": { + "args": { + "urlVars": {} + }, + "cause": "", + "causeMessage": "", + "code": "UNAUTHORIZED", + "message": "The request could not be completed. The session is not authorized or the credentials are invalid", + "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" + }, + "meta": { + "apiEnrollmentVersion": "0.0.1", + "apiVersion": "0.0.1" + } + } + } + }, + "429": { + "description": "The resource requested is rate limited and the rate limit has been exceeded", + "schema": { + "$ref": "#/definitions/apiErrorEnvelope" + }, + "examples": { + "application/json": { + "error": { + "args": { + "urlVars": {} + }, + "causeMessage": "you have hit a rate limit in the requested operation", + "code": "RATE_LIMITED", + "message": "The resource is rate limited and the rate limit has been exceeded. Please try again later", + "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" + }, + "meta": { + "apiEnrollmentVersion": "0.0.1", + "apiVersion": "0.0.1" + } + } + } + } + } + } + }, "/posture-check-types": { "get": { "security": [ diff --git a/rest_management_api_server/operations/config/list_config_services.go b/rest_management_api_server/operations/config/list_config_services.go new file mode 100644 index 00000000..c87d83f1 --- /dev/null +++ b/rest_management_api_server/operations/config/list_config_services.go @@ -0,0 +1,96 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry Inc. +// +// 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 +// +// https://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. +// +// __ __ _ +// \ \ / / (_) +// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ +// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | +// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. +// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | +// __/ | +// |___/ + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// ListConfigServicesHandlerFunc turns a function with the right signature into a list config services handler +type ListConfigServicesHandlerFunc func(ListConfigServicesParams, interface{}) middleware.Responder + +// Handle executing the request and returning a response +func (fn ListConfigServicesHandlerFunc) Handle(params ListConfigServicesParams, principal interface{}) middleware.Responder { + return fn(params, principal) +} + +// ListConfigServicesHandler interface for that can handle valid list config services params +type ListConfigServicesHandler interface { + Handle(ListConfigServicesParams, interface{}) middleware.Responder +} + +// NewListConfigServices creates a new http.Handler for the list config services operation +func NewListConfigServices(ctx *middleware.Context, handler ListConfigServicesHandler) *ListConfigServices { + return &ListConfigServices{Context: ctx, Handler: handler} +} + +/* ListConfigServices swagger:route GET /configs/{id}/services Config listConfigServices + +List services referenced by a config + +Retrieves a list of service resources that reference a given config; supports filtering, sorting, and pagination. Requires admin access. + + +*/ +type ListConfigServices struct { + Context *middleware.Context + Handler ListConfigServicesHandler +} + +func (o *ListConfigServices) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewListConfigServicesParams() + uprinc, aCtx, err := o.Context.Authorize(r, route) + if err != nil { + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + if aCtx != nil { + *r = *aCtx + } + var principal interface{} + if uprinc != nil { + principal = uprinc.(interface{}) // this is really a interface{}, I promise + } + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params, principal) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/rest_management_api_server/operations/config/list_config_services_parameters.go b/rest_management_api_server/operations/config/list_config_services_parameters.go new file mode 100644 index 00000000..f2433222 --- /dev/null +++ b/rest_management_api_server/operations/config/list_config_services_parameters.go @@ -0,0 +1,190 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry Inc. +// +// 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 +// +// https://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. +// +// __ __ _ +// \ \ / / (_) +// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ +// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | +// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. +// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | +// __/ | +// |___/ + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListConfigServicesParams creates a new ListConfigServicesParams object +// +// There are no default values defined in the spec. +func NewListConfigServicesParams() ListConfigServicesParams { + + return ListConfigServicesParams{} +} + +// ListConfigServicesParams contains all the bound params for the list config services operation +// typically these are obtained from a http.Request +// +// swagger:parameters listConfigServices +type ListConfigServicesParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + In: query + */ + Filter *string + /*The id of the requested resource + Required: true + In: path + */ + ID string + /* + In: query + */ + Limit *int64 + /* + In: query + */ + Offset *int64 +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewListConfigServicesParams() beforehand. +func (o *ListConfigServicesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + qFilter, qhkFilter, _ := qs.GetOK("filter") + if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { + res = append(res, err) + } + + rID, rhkID, _ := route.Params.GetOK("id") + if err := o.bindID(rID, rhkID, route.Formats); err != nil { + res = append(res, err) + } + + qLimit, qhkLimit, _ := qs.GetOK("limit") + if err := o.bindLimit(qLimit, qhkLimit, route.Formats); err != nil { + res = append(res, err) + } + + qOffset, qhkOffset, _ := qs.GetOK("offset") + if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindFilter binds and validates parameter Filter from query. +func (o *ListConfigServicesParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.Filter = &raw + + return nil +} + +// bindID binds and validates parameter ID from path. +func (o *ListConfigServicesParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + o.ID = raw + + return nil +} + +// bindLimit binds and validates parameter Limit from query. +func (o *ListConfigServicesParams) bindLimit(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("limit", "query", "int64", raw) + } + o.Limit = &value + + return nil +} + +// bindOffset binds and validates parameter Offset from query. +func (o *ListConfigServicesParams) bindOffset(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("offset", "query", "int64", raw) + } + o.Offset = &value + + return nil +} diff --git a/rest_management_api_server/operations/config/list_config_services_responses.go b/rest_management_api_server/operations/config/list_config_services_responses.go new file mode 100644 index 00000000..62f95afd --- /dev/null +++ b/rest_management_api_server/operations/config/list_config_services_responses.go @@ -0,0 +1,214 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry Inc. +// +// 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 +// +// https://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. +// +// __ __ _ +// \ \ / / (_) +// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ +// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | +// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. +// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | +// __/ | +// |___/ + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/openziti/edge-api/rest_model" +) + +// ListConfigServicesOKCode is the HTTP code returned for type ListConfigServicesOK +const ListConfigServicesOKCode int = 200 + +/*ListConfigServicesOK A list of services + +swagger:response listConfigServicesOK +*/ +type ListConfigServicesOK struct { + + /* + In: Body + */ + Payload *rest_model.ListServicesEnvelope `json:"body,omitempty"` +} + +// NewListConfigServicesOK creates ListConfigServicesOK with default headers values +func NewListConfigServicesOK() *ListConfigServicesOK { + + return &ListConfigServicesOK{} +} + +// WithPayload adds the payload to the list config services o k response +func (o *ListConfigServicesOK) WithPayload(payload *rest_model.ListServicesEnvelope) *ListConfigServicesOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the list config services o k response +func (o *ListConfigServicesOK) SetPayload(payload *rest_model.ListServicesEnvelope) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ListConfigServicesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ListConfigServicesBadRequestCode is the HTTP code returned for type ListConfigServicesBadRequest +const ListConfigServicesBadRequestCode int = 400 + +/*ListConfigServicesBadRequest The requested resource does not exist + +swagger:response listConfigServicesBadRequest +*/ +type ListConfigServicesBadRequest struct { + + /* + In: Body + */ + Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` +} + +// NewListConfigServicesBadRequest creates ListConfigServicesBadRequest with default headers values +func NewListConfigServicesBadRequest() *ListConfigServicesBadRequest { + + return &ListConfigServicesBadRequest{} +} + +// WithPayload adds the payload to the list config services bad request response +func (o *ListConfigServicesBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *ListConfigServicesBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the list config services bad request response +func (o *ListConfigServicesBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ListConfigServicesBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ListConfigServicesUnauthorizedCode is the HTTP code returned for type ListConfigServicesUnauthorized +const ListConfigServicesUnauthorizedCode int = 401 + +/*ListConfigServicesUnauthorized The supplied session does not have the correct access rights to request this resource + +swagger:response listConfigServicesUnauthorized +*/ +type ListConfigServicesUnauthorized struct { + + /* + In: Body + */ + Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` +} + +// NewListConfigServicesUnauthorized creates ListConfigServicesUnauthorized with default headers values +func NewListConfigServicesUnauthorized() *ListConfigServicesUnauthorized { + + return &ListConfigServicesUnauthorized{} +} + +// WithPayload adds the payload to the list config services unauthorized response +func (o *ListConfigServicesUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListConfigServicesUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the list config services unauthorized response +func (o *ListConfigServicesUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ListConfigServicesUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ListConfigServicesTooManyRequestsCode is the HTTP code returned for type ListConfigServicesTooManyRequests +const ListConfigServicesTooManyRequestsCode int = 429 + +/*ListConfigServicesTooManyRequests The resource requested is rate limited and the rate limit has been exceeded + +swagger:response listConfigServicesTooManyRequests +*/ +type ListConfigServicesTooManyRequests struct { + + /* + In: Body + */ + Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` +} + +// NewListConfigServicesTooManyRequests creates ListConfigServicesTooManyRequests with default headers values +func NewListConfigServicesTooManyRequests() *ListConfigServicesTooManyRequests { + + return &ListConfigServicesTooManyRequests{} +} + +// WithPayload adds the payload to the list config services too many requests response +func (o *ListConfigServicesTooManyRequests) WithPayload(payload *rest_model.APIErrorEnvelope) *ListConfigServicesTooManyRequests { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the list config services too many requests response +func (o *ListConfigServicesTooManyRequests) SetPayload(payload *rest_model.APIErrorEnvelope) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ListConfigServicesTooManyRequests) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(429) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/rest_management_api_server/operations/config/list_config_services_urlbuilder.go b/rest_management_api_server/operations/config/list_config_services_urlbuilder.go new file mode 100644 index 00000000..fb50a27f --- /dev/null +++ b/rest_management_api_server/operations/config/list_config_services_urlbuilder.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry Inc. +// +// 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 +// +// https://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. +// +// __ __ _ +// \ \ / / (_) +// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ +// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | +// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. +// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | +// __/ | +// |___/ + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/swag" +) + +// ListConfigServicesURL generates an URL for the list config services operation +type ListConfigServicesURL struct { + ID string + + Filter *string + Limit *int64 + Offset *int64 + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ListConfigServicesURL) WithBasePath(bp string) *ListConfigServicesURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ListConfigServicesURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *ListConfigServicesURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/configs/{id}/services" + + id := o.ID + if id != "" { + _path = strings.Replace(_path, "{id}", id, -1) + } else { + return nil, errors.New("id is required on ListConfigServicesURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/edge/management/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + var filterQ string + if o.Filter != nil { + filterQ = *o.Filter + } + if filterQ != "" { + qs.Set("filter", filterQ) + } + + var limitQ string + if o.Limit != nil { + limitQ = swag.FormatInt64(*o.Limit) + } + if limitQ != "" { + qs.Set("limit", limitQ) + } + + var offsetQ string + if o.Offset != nil { + offsetQ = swag.FormatInt64(*o.Offset) + } + if offsetQ != "" { + qs.Set("offset", offsetQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *ListConfigServicesURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *ListConfigServicesURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *ListConfigServicesURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on ListConfigServicesURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on ListConfigServicesURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *ListConfigServicesURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/rest_management_api_server/operations/role_attributes/list_posture_check_role_attributes.go b/rest_management_api_server/operations/role_attributes/list_posture_check_role_attributes.go new file mode 100644 index 00000000..5f66a51f --- /dev/null +++ b/rest_management_api_server/operations/role_attributes/list_posture_check_role_attributes.go @@ -0,0 +1,96 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry Inc. +// +// 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 +// +// https://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. +// +// __ __ _ +// \ \ / / (_) +// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ +// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | +// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. +// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | +// __/ | +// |___/ + +package role_attributes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// ListPostureCheckRoleAttributesHandlerFunc turns a function with the right signature into a list posture check role attributes handler +type ListPostureCheckRoleAttributesHandlerFunc func(ListPostureCheckRoleAttributesParams, interface{}) middleware.Responder + +// Handle executing the request and returning a response +func (fn ListPostureCheckRoleAttributesHandlerFunc) Handle(params ListPostureCheckRoleAttributesParams, principal interface{}) middleware.Responder { + return fn(params, principal) +} + +// ListPostureCheckRoleAttributesHandler interface for that can handle valid list posture check role attributes params +type ListPostureCheckRoleAttributesHandler interface { + Handle(ListPostureCheckRoleAttributesParams, interface{}) middleware.Responder +} + +// NewListPostureCheckRoleAttributes creates a new http.Handler for the list posture check role attributes operation +func NewListPostureCheckRoleAttributes(ctx *middleware.Context, handler ListPostureCheckRoleAttributesHandler) *ListPostureCheckRoleAttributes { + return &ListPostureCheckRoleAttributes{Context: ctx, Handler: handler} +} + +/* ListPostureCheckRoleAttributes swagger:route GET /posture-check-role-attributes Role Attributes listPostureCheckRoleAttributes + +List role attributes in use by posture checks + +Retrieves a list of role attributes in use by posture checks; supports filtering, sorting, and pagination. Requires admin access. + + +*/ +type ListPostureCheckRoleAttributes struct { + Context *middleware.Context + Handler ListPostureCheckRoleAttributesHandler +} + +func (o *ListPostureCheckRoleAttributes) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewListPostureCheckRoleAttributesParams() + uprinc, aCtx, err := o.Context.Authorize(r, route) + if err != nil { + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + if aCtx != nil { + *r = *aCtx + } + var principal interface{} + if uprinc != nil { + principal = uprinc.(interface{}) // this is really a interface{}, I promise + } + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params, principal) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/rest_management_api_server/operations/role_attributes/list_posture_check_role_attributes_parameters.go b/rest_management_api_server/operations/role_attributes/list_posture_check_role_attributes_parameters.go new file mode 100644 index 00000000..e77e5e5e --- /dev/null +++ b/rest_management_api_server/operations/role_attributes/list_posture_check_role_attributes_parameters.go @@ -0,0 +1,166 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry Inc. +// +// 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 +// +// https://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. +// +// __ __ _ +// \ \ / / (_) +// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ +// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | +// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. +// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | +// __/ | +// |___/ + +package role_attributes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListPostureCheckRoleAttributesParams creates a new ListPostureCheckRoleAttributesParams object +// +// There are no default values defined in the spec. +func NewListPostureCheckRoleAttributesParams() ListPostureCheckRoleAttributesParams { + + return ListPostureCheckRoleAttributesParams{} +} + +// ListPostureCheckRoleAttributesParams contains all the bound params for the list posture check role attributes operation +// typically these are obtained from a http.Request +// +// swagger:parameters listPostureCheckRoleAttributes +type ListPostureCheckRoleAttributesParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + In: query + */ + Filter *string + /* + In: query + */ + Limit *int64 + /* + In: query + */ + Offset *int64 +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewListPostureCheckRoleAttributesParams() beforehand. +func (o *ListPostureCheckRoleAttributesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + qFilter, qhkFilter, _ := qs.GetOK("filter") + if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { + res = append(res, err) + } + + qLimit, qhkLimit, _ := qs.GetOK("limit") + if err := o.bindLimit(qLimit, qhkLimit, route.Formats); err != nil { + res = append(res, err) + } + + qOffset, qhkOffset, _ := qs.GetOK("offset") + if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindFilter binds and validates parameter Filter from query. +func (o *ListPostureCheckRoleAttributesParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.Filter = &raw + + return nil +} + +// bindLimit binds and validates parameter Limit from query. +func (o *ListPostureCheckRoleAttributesParams) bindLimit(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("limit", "query", "int64", raw) + } + o.Limit = &value + + return nil +} + +// bindOffset binds and validates parameter Offset from query. +func (o *ListPostureCheckRoleAttributesParams) bindOffset(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("offset", "query", "int64", raw) + } + o.Offset = &value + + return nil +} diff --git a/rest_management_api_server/operations/role_attributes/list_posture_check_role_attributes_responses.go b/rest_management_api_server/operations/role_attributes/list_posture_check_role_attributes_responses.go new file mode 100644 index 00000000..be7e9a2f --- /dev/null +++ b/rest_management_api_server/operations/role_attributes/list_posture_check_role_attributes_responses.go @@ -0,0 +1,214 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry Inc. +// +// 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 +// +// https://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. +// +// __ __ _ +// \ \ / / (_) +// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ +// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | +// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. +// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | +// __/ | +// |___/ + +package role_attributes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/openziti/edge-api/rest_model" +) + +// ListPostureCheckRoleAttributesOKCode is the HTTP code returned for type ListPostureCheckRoleAttributesOK +const ListPostureCheckRoleAttributesOKCode int = 200 + +/*ListPostureCheckRoleAttributesOK A list of role attributes + +swagger:response listPostureCheckRoleAttributesOK +*/ +type ListPostureCheckRoleAttributesOK struct { + + /* + In: Body + */ + Payload *rest_model.ListRoleAttributesEnvelope `json:"body,omitempty"` +} + +// NewListPostureCheckRoleAttributesOK creates ListPostureCheckRoleAttributesOK with default headers values +func NewListPostureCheckRoleAttributesOK() *ListPostureCheckRoleAttributesOK { + + return &ListPostureCheckRoleAttributesOK{} +} + +// WithPayload adds the payload to the list posture check role attributes o k response +func (o *ListPostureCheckRoleAttributesOK) WithPayload(payload *rest_model.ListRoleAttributesEnvelope) *ListPostureCheckRoleAttributesOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the list posture check role attributes o k response +func (o *ListPostureCheckRoleAttributesOK) SetPayload(payload *rest_model.ListRoleAttributesEnvelope) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ListPostureCheckRoleAttributesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ListPostureCheckRoleAttributesBadRequestCode is the HTTP code returned for type ListPostureCheckRoleAttributesBadRequest +const ListPostureCheckRoleAttributesBadRequestCode int = 400 + +/*ListPostureCheckRoleAttributesBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information + +swagger:response listPostureCheckRoleAttributesBadRequest +*/ +type ListPostureCheckRoleAttributesBadRequest struct { + + /* + In: Body + */ + Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` +} + +// NewListPostureCheckRoleAttributesBadRequest creates ListPostureCheckRoleAttributesBadRequest with default headers values +func NewListPostureCheckRoleAttributesBadRequest() *ListPostureCheckRoleAttributesBadRequest { + + return &ListPostureCheckRoleAttributesBadRequest{} +} + +// WithPayload adds the payload to the list posture check role attributes bad request response +func (o *ListPostureCheckRoleAttributesBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *ListPostureCheckRoleAttributesBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the list posture check role attributes bad request response +func (o *ListPostureCheckRoleAttributesBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ListPostureCheckRoleAttributesBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ListPostureCheckRoleAttributesUnauthorizedCode is the HTTP code returned for type ListPostureCheckRoleAttributesUnauthorized +const ListPostureCheckRoleAttributesUnauthorizedCode int = 401 + +/*ListPostureCheckRoleAttributesUnauthorized The supplied session does not have the correct access rights to request this resource + +swagger:response listPostureCheckRoleAttributesUnauthorized +*/ +type ListPostureCheckRoleAttributesUnauthorized struct { + + /* + In: Body + */ + Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` +} + +// NewListPostureCheckRoleAttributesUnauthorized creates ListPostureCheckRoleAttributesUnauthorized with default headers values +func NewListPostureCheckRoleAttributesUnauthorized() *ListPostureCheckRoleAttributesUnauthorized { + + return &ListPostureCheckRoleAttributesUnauthorized{} +} + +// WithPayload adds the payload to the list posture check role attributes unauthorized response +func (o *ListPostureCheckRoleAttributesUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListPostureCheckRoleAttributesUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the list posture check role attributes unauthorized response +func (o *ListPostureCheckRoleAttributesUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ListPostureCheckRoleAttributesUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ListPostureCheckRoleAttributesTooManyRequestsCode is the HTTP code returned for type ListPostureCheckRoleAttributesTooManyRequests +const ListPostureCheckRoleAttributesTooManyRequestsCode int = 429 + +/*ListPostureCheckRoleAttributesTooManyRequests The resource requested is rate limited and the rate limit has been exceeded + +swagger:response listPostureCheckRoleAttributesTooManyRequests +*/ +type ListPostureCheckRoleAttributesTooManyRequests struct { + + /* + In: Body + */ + Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` +} + +// NewListPostureCheckRoleAttributesTooManyRequests creates ListPostureCheckRoleAttributesTooManyRequests with default headers values +func NewListPostureCheckRoleAttributesTooManyRequests() *ListPostureCheckRoleAttributesTooManyRequests { + + return &ListPostureCheckRoleAttributesTooManyRequests{} +} + +// WithPayload adds the payload to the list posture check role attributes too many requests response +func (o *ListPostureCheckRoleAttributesTooManyRequests) WithPayload(payload *rest_model.APIErrorEnvelope) *ListPostureCheckRoleAttributesTooManyRequests { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the list posture check role attributes too many requests response +func (o *ListPostureCheckRoleAttributesTooManyRequests) SetPayload(payload *rest_model.APIErrorEnvelope) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ListPostureCheckRoleAttributesTooManyRequests) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(429) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/rest_management_api_server/operations/role_attributes/list_posture_check_role_attributes_urlbuilder.go b/rest_management_api_server/operations/role_attributes/list_posture_check_role_attributes_urlbuilder.go new file mode 100644 index 00000000..eb68298f --- /dev/null +++ b/rest_management_api_server/operations/role_attributes/list_posture_check_role_attributes_urlbuilder.go @@ -0,0 +1,147 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry Inc. +// +// 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 +// +// https://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. +// +// __ __ _ +// \ \ / / (_) +// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ +// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | +// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. +// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | +// __/ | +// |___/ + +package role_attributes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + + "github.com/go-openapi/swag" +) + +// ListPostureCheckRoleAttributesURL generates an URL for the list posture check role attributes operation +type ListPostureCheckRoleAttributesURL struct { + Filter *string + Limit *int64 + Offset *int64 + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ListPostureCheckRoleAttributesURL) WithBasePath(bp string) *ListPostureCheckRoleAttributesURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ListPostureCheckRoleAttributesURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *ListPostureCheckRoleAttributesURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/posture-check-role-attributes" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/edge/management/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + var filterQ string + if o.Filter != nil { + filterQ = *o.Filter + } + if filterQ != "" { + qs.Set("filter", filterQ) + } + + var limitQ string + if o.Limit != nil { + limitQ = swag.FormatInt64(*o.Limit) + } + if limitQ != "" { + qs.Set("limit", limitQ) + } + + var offsetQ string + if o.Offset != nil { + offsetQ = swag.FormatInt64(*o.Offset) + } + if offsetQ != "" { + qs.Set("offset", offsetQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *ListPostureCheckRoleAttributesURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *ListPostureCheckRoleAttributesURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *ListPostureCheckRoleAttributesURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on ListPostureCheckRoleAttributesURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on ListPostureCheckRoleAttributesURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *ListPostureCheckRoleAttributesURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/rest_management_api_server/operations/ziti_edge_management_api.go b/rest_management_api_server/operations/ziti_edge_management_api.go index f92abb0c..78fdb039 100644 --- a/rest_management_api_server/operations/ziti_edge_management_api.go +++ b/rest_management_api_server/operations/ziti_edge_management_api.go @@ -380,6 +380,9 @@ func NewZitiEdgeManagementAPI(spec *loads.Document) *ZitiEdgeManagementAPI { CertificateAuthorityListCasHandler: certificate_authority.ListCasHandlerFunc(func(params certificate_authority.ListCasParams, principal interface{}) middleware.Responder { return middleware.NotImplemented("operation certificate_authority.ListCas has not yet been implemented") }), + ConfigListConfigServicesHandler: config.ListConfigServicesHandlerFunc(func(params config.ListConfigServicesParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation config.ListConfigServices has not yet been implemented") + }), ConfigListConfigTypesHandler: config.ListConfigTypesHandlerFunc(func(params config.ListConfigTypesParams, principal interface{}) middleware.Responder { return middleware.NotImplemented("operation config.ListConfigTypes has not yet been implemented") }), @@ -455,6 +458,9 @@ func NewZitiEdgeManagementAPI(spec *loads.Document) *ZitiEdgeManagementAPI { IdentityListIdentitysServiceConfigsHandler: identity.ListIdentitysServiceConfigsHandlerFunc(func(params identity.ListIdentitysServiceConfigsParams, principal interface{}) middleware.Responder { return middleware.NotImplemented("operation identity.ListIdentitysServiceConfigs has not yet been implemented") }), + RoleAttributesListPostureCheckRoleAttributesHandler: role_attributes.ListPostureCheckRoleAttributesHandlerFunc(func(params role_attributes.ListPostureCheckRoleAttributesParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation role_attributes.ListPostureCheckRoleAttributes has not yet been implemented") + }), PostureChecksListPostureCheckTypesHandler: posture_checks.ListPostureCheckTypesHandlerFunc(func(params posture_checks.ListPostureCheckTypesParams, principal interface{}) middleware.Responder { return middleware.NotImplemented("operation posture_checks.ListPostureCheckTypes has not yet been implemented") }), @@ -912,6 +918,8 @@ type ZitiEdgeManagementAPI struct { AuthenticatorListAuthenticatorsHandler authenticator.ListAuthenticatorsHandler // CertificateAuthorityListCasHandler sets the operation handler for the list cas operation CertificateAuthorityListCasHandler certificate_authority.ListCasHandler + // ConfigListConfigServicesHandler sets the operation handler for the list config services operation + ConfigListConfigServicesHandler config.ListConfigServicesHandler // ConfigListConfigTypesHandler sets the operation handler for the list config types operation ConfigListConfigTypesHandler config.ListConfigTypesHandler // ConfigListConfigsHandler sets the operation handler for the list configs operation @@ -962,6 +970,8 @@ type ZitiEdgeManagementAPI struct { IdentityListIdentitysEdgeRouterPoliciesHandler identity.ListIdentitysEdgeRouterPoliciesHandler // IdentityListIdentitysServiceConfigsHandler sets the operation handler for the list identitys service configs operation IdentityListIdentitysServiceConfigsHandler identity.ListIdentitysServiceConfigsHandler + // RoleAttributesListPostureCheckRoleAttributesHandler sets the operation handler for the list posture check role attributes operation + RoleAttributesListPostureCheckRoleAttributesHandler role_attributes.ListPostureCheckRoleAttributesHandler // PostureChecksListPostureCheckTypesHandler sets the operation handler for the list posture check types operation PostureChecksListPostureCheckTypesHandler posture_checks.ListPostureCheckTypesHandler // PostureChecksListPostureChecksHandler sets the operation handler for the list posture checks operation @@ -1471,6 +1481,9 @@ func (o *ZitiEdgeManagementAPI) Validate() error { if o.CertificateAuthorityListCasHandler == nil { unregistered = append(unregistered, "certificate_authority.ListCasHandler") } + if o.ConfigListConfigServicesHandler == nil { + unregistered = append(unregistered, "config.ListConfigServicesHandler") + } if o.ConfigListConfigTypesHandler == nil { unregistered = append(unregistered, "config.ListConfigTypesHandler") } @@ -1546,6 +1559,9 @@ func (o *ZitiEdgeManagementAPI) Validate() error { if o.IdentityListIdentitysServiceConfigsHandler == nil { unregistered = append(unregistered, "identity.ListIdentitysServiceConfigsHandler") } + if o.RoleAttributesListPostureCheckRoleAttributesHandler == nil { + unregistered = append(unregistered, "role_attributes.ListPostureCheckRoleAttributesHandler") + } if o.PostureChecksListPostureCheckTypesHandler == nil { unregistered = append(unregistered, "posture_checks.ListPostureCheckTypesHandler") } @@ -2228,6 +2244,10 @@ func (o *ZitiEdgeManagementAPI) initHandlerCache() { if o.handlers["GET"] == nil { o.handlers["GET"] = make(map[string]http.Handler) } + o.handlers["GET"]["/configs/{id}/services"] = config.NewListConfigServices(o.context, o.ConfigListConfigServicesHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } o.handlers["GET"]["/config-types"] = config.NewListConfigTypes(o.context, o.ConfigListConfigTypesHandler) if o.handlers["GET"] == nil { o.handlers["GET"] = make(map[string]http.Handler) @@ -2328,6 +2348,10 @@ func (o *ZitiEdgeManagementAPI) initHandlerCache() { if o.handlers["GET"] == nil { o.handlers["GET"] = make(map[string]http.Handler) } + o.handlers["GET"]["/posture-check-role-attributes"] = role_attributes.NewListPostureCheckRoleAttributes(o.context, o.RoleAttributesListPostureCheckRoleAttributesHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } o.handlers["GET"]["/posture-check-types"] = posture_checks.NewListPostureCheckTypes(o.context, o.PostureChecksListPostureCheckTypesHandler) if o.handlers["GET"] == nil { o.handlers["GET"] = make(map[string]http.Handler) diff --git a/source/management.yml b/source/management.yml index bc386ad3..57085190 100644 --- a/source/management.yml +++ b/source/management.yml @@ -81,6 +81,8 @@ paths: $ref: 'management/configs.yml#/paths/configs' '/configs/{id}': $ref: 'management/configs.yml#/paths/configs-id' + '/configs/{id}/services': + $ref: 'management/configs.yml#/paths/configs-id-services' '/controllers': $ref: 'shared/controllers.yml#/paths/controllers' @@ -201,6 +203,9 @@ paths: '/posture-checks/{id}': $ref: 'management/posture-checks.yml#/paths/posture-checks-id' + '/posture-check-role-attributes': + $ref: 'management/role-attributes.yml#/paths/posture-check-role-attributes' + '/posture-check-types': $ref: 'management/posture-check-types.yml#/paths/posture-check-types' '/posture-check-types/{id}': diff --git a/source/management/configs.yml b/source/management/configs.yml index 5d37aecd..a44f594a 100644 --- a/source/management/configs.yml +++ b/source/management/configs.yml @@ -150,6 +150,32 @@ paths: '429': $ref: '../shared/standard-responses.yml#/responses/rateLimitedResponse' + configs-id-services: + parameters: + - $ref: '../shared/parameters.yml#/id' + get: + summary: List services referenced by a config + description: | + Retrieves a list of service resources that reference a given config; supports filtering, sorting, and pagination. Requires admin access. + security: + - ztSession: [ ] + tags: + - Config + operationId: listConfigServices + parameters: + - $ref: '../shared/parameters.yml#/limit' + - $ref: '../shared/parameters.yml#/offset' + - $ref: '../shared/parameters.yml#/filter' + responses: + '200': + $ref: '../shared/services.yml#/responses/listServices' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '429': + $ref: '../shared/standard-responses.yml#/responses/rateLimitedResponse' + responses: listConfigs: description: A list of configs diff --git a/source/management/role-attributes.yml b/source/management/role-attributes.yml index caa738f5..3655f53c 100644 --- a/source/management/role-attributes.yml +++ b/source/management/role-attributes.yml @@ -75,6 +75,31 @@ paths: '429': $ref: '../shared/standard-responses.yml#/responses/rateLimitedResponse' + posture-check-role-attributes: + get: + summary: List role attributes in use by posture checks + description: | + Retrieves a list of role attributes in use by posture checks; supports filtering, sorting, and pagination. Requires admin access. + security: + - ztSession: [ ] + - oauth2: [ openid ] + tags: + - Role Attributes + operationId: listPostureCheckRoleAttributes + parameters: + - $ref: '../shared/parameters.yml#/limit' + - $ref: '../shared/parameters.yml#/offset' + - $ref: '../shared/parameters.yml#/filter' + responses: + '200': + $ref: '#/responses/listRoleAttributes' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '429': + $ref: '../shared/standard-responses.yml#/responses/rateLimitedResponse' + responses: listRoleAttributes: description: A list of role attributes