Merge pull request #724 from openziti/add.missing.401.required.ca.id.name

add missing 401s to list operations, missing required
This commit is contained in:
Andrew
2021-07-27 08:52:58 -04:00
committed by GitHub
25 changed files with 940 additions and 4 deletions
+1 -1
View File
@@ -91,7 +91,7 @@ func MapUpdateCaToModel(id string, ca *rest_model.CaUpdate) *model.Ca {
IsOttCaEnrollmentEnabled: ca.IsOttCaEnrollmentEnabled != nil && *ca.IsOttCaEnrollmentEnabled,
IsAuthEnabled: ca.IsAuthEnabled != nil && *ca.IsAuthEnabled,
IdentityRoles: ca.IdentityRoles,
IdentityNameFormat: ca.IdentityNameFormat,
IdentityNameFormat: stringz.OrEmpty(ca.IdentityNameFormat),
}
return ret
@@ -53,6 +53,12 @@ func (o *ListCurrentAPISessionCertificatesReader) ReadResponse(response runtime.
return nil, err
}
return result, nil
case 401:
result := NewListCurrentAPISessionCertificatesUnauthorized()
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())
}
@@ -89,3 +95,35 @@ func (o *ListCurrentAPISessionCertificatesOK) readResponse(response runtime.Clie
return nil
}
// NewListCurrentAPISessionCertificatesUnauthorized creates a ListCurrentAPISessionCertificatesUnauthorized with default headers values
func NewListCurrentAPISessionCertificatesUnauthorized() *ListCurrentAPISessionCertificatesUnauthorized {
return &ListCurrentAPISessionCertificatesUnauthorized{}
}
/* ListCurrentAPISessionCertificatesUnauthorized describes a response with status code 401, with default header values.
The currently supplied session does not have the correct access rights to request this resource
*/
type ListCurrentAPISessionCertificatesUnauthorized struct {
Payload *rest_model.APIErrorEnvelope
}
func (o *ListCurrentAPISessionCertificatesUnauthorized) Error() string {
return fmt.Sprintf("[GET /current-api-session/certificates][%d] listCurrentApiSessionCertificatesUnauthorized %+v", 401, o.Payload)
}
func (o *ListCurrentAPISessionCertificatesUnauthorized) GetPayload() *rest_model.APIErrorEnvelope {
return o.Payload
}
func (o *ListCurrentAPISessionCertificatesUnauthorized) 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
}
+48
View File
@@ -442,6 +442,30 @@ func init() {
"schema": {
"$ref": "#/definitions/listCurrentApiSessionCertificatesEnvelope"
}
},
"401": {
"description": "The currently 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": {
"apiEnrolmentVersion": "0.0.1",
"apiVersion": "0.0.1"
}
}
}
}
}
},
@@ -5707,6 +5731,30 @@ func init() {
"schema": {
"$ref": "#/definitions/listCurrentApiSessionCertificatesEnvelope"
}
},
"401": {
"description": "The currently 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": {
"apiEnrolmentVersion": "0.0.1",
"apiVersion": "0.0.1"
}
}
}
}
}
},
@@ -80,3 +80,47 @@ func (o *ListCurrentAPISessionCertificatesOK) WriteResponse(rw http.ResponseWrit
}
}
}
// ListCurrentAPISessionCertificatesUnauthorizedCode is the HTTP code returned for type ListCurrentAPISessionCertificatesUnauthorized
const ListCurrentAPISessionCertificatesUnauthorizedCode int = 401
/*ListCurrentAPISessionCertificatesUnauthorized The currently supplied session does not have the correct access rights to request this resource
swagger:response listCurrentApiSessionCertificatesUnauthorized
*/
type ListCurrentAPISessionCertificatesUnauthorized struct {
/*
In: Body
*/
Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"`
}
// NewListCurrentAPISessionCertificatesUnauthorized creates ListCurrentAPISessionCertificatesUnauthorized with default headers values
func NewListCurrentAPISessionCertificatesUnauthorized() *ListCurrentAPISessionCertificatesUnauthorized {
return &ListCurrentAPISessionCertificatesUnauthorized{}
}
// WithPayload adds the payload to the list current Api session certificates unauthorized response
func (o *ListCurrentAPISessionCertificatesUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListCurrentAPISessionCertificatesUnauthorized {
o.Payload = payload
return o
}
// SetPayload sets the payload to the list current Api session certificates unauthorized response
func (o *ListCurrentAPISessionCertificatesUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) {
o.Payload = payload
}
// WriteResponse to the client
func (o *ListCurrentAPISessionCertificatesUnauthorized) 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
}
}
}
@@ -53,6 +53,12 @@ func (o *ListAPISessionsReader) ReadResponse(response runtime.ClientResponse, co
return nil, err
}
return result, nil
case 401:
result := NewListAPISessionsUnauthorized()
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())
}
@@ -89,3 +95,35 @@ func (o *ListAPISessionsOK) readResponse(response runtime.ClientResponse, consum
return nil
}
// NewListAPISessionsUnauthorized creates a ListAPISessionsUnauthorized with default headers values
func NewListAPISessionsUnauthorized() *ListAPISessionsUnauthorized {
return &ListAPISessionsUnauthorized{}
}
/* ListAPISessionsUnauthorized describes a response with status code 401, with default header values.
The currently supplied session does not have the correct access rights to request this resource
*/
type ListAPISessionsUnauthorized struct {
Payload *rest_model.APIErrorEnvelope
}
func (o *ListAPISessionsUnauthorized) Error() string {
return fmt.Sprintf("[GET /api-sessions][%d] listApiSessionsUnauthorized %+v", 401, o.Payload)
}
func (o *ListAPISessionsUnauthorized) GetPayload() *rest_model.APIErrorEnvelope {
return o.Payload
}
func (o *ListAPISessionsUnauthorized) 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
}
@@ -53,6 +53,12 @@ func (o *ListCasReader) ReadResponse(response runtime.ClientResponse, consumer r
return nil, err
}
return result, nil
case 401:
result := NewListCasUnauthorized()
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())
}
@@ -89,3 +95,35 @@ func (o *ListCasOK) readResponse(response runtime.ClientResponse, consumer runti
return nil
}
// NewListCasUnauthorized creates a ListCasUnauthorized with default headers values
func NewListCasUnauthorized() *ListCasUnauthorized {
return &ListCasUnauthorized{}
}
/* ListCasUnauthorized describes a response with status code 401, with default header values.
The currently supplied session does not have the correct access rights to request this resource
*/
type ListCasUnauthorized struct {
Payload *rest_model.APIErrorEnvelope
}
func (o *ListCasUnauthorized) Error() string {
return fmt.Sprintf("[GET /cas][%d] listCasUnauthorized %+v", 401, o.Payload)
}
func (o *ListCasUnauthorized) GetPayload() *rest_model.APIErrorEnvelope {
return o.Payload
}
func (o *ListCasUnauthorized) 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
}
@@ -53,6 +53,12 @@ func (o *ListConfigTypesReader) ReadResponse(response runtime.ClientResponse, co
return nil, err
}
return result, nil
case 401:
result := NewListConfigTypesUnauthorized()
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())
}
@@ -89,3 +95,35 @@ func (o *ListConfigTypesOK) readResponse(response runtime.ClientResponse, consum
return nil
}
// NewListConfigTypesUnauthorized creates a ListConfigTypesUnauthorized with default headers values
func NewListConfigTypesUnauthorized() *ListConfigTypesUnauthorized {
return &ListConfigTypesUnauthorized{}
}
/* ListConfigTypesUnauthorized describes a response with status code 401, with default header values.
The currently supplied session does not have the correct access rights to request this resource
*/
type ListConfigTypesUnauthorized struct {
Payload *rest_model.APIErrorEnvelope
}
func (o *ListConfigTypesUnauthorized) Error() string {
return fmt.Sprintf("[GET /config-types][%d] listConfigTypesUnauthorized %+v", 401, o.Payload)
}
func (o *ListConfigTypesUnauthorized) GetPayload() *rest_model.APIErrorEnvelope {
return o.Payload
}
func (o *ListConfigTypesUnauthorized) 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
}
@@ -53,6 +53,12 @@ func (o *ListPostureCheckTypesReader) ReadResponse(response runtime.ClientRespon
return nil, err
}
return result, nil
case 401:
result := NewListPostureCheckTypesUnauthorized()
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())
}
@@ -89,3 +95,35 @@ func (o *ListPostureCheckTypesOK) readResponse(response runtime.ClientResponse,
return nil
}
// NewListPostureCheckTypesUnauthorized creates a ListPostureCheckTypesUnauthorized with default headers values
func NewListPostureCheckTypesUnauthorized() *ListPostureCheckTypesUnauthorized {
return &ListPostureCheckTypesUnauthorized{}
}
/* ListPostureCheckTypesUnauthorized describes a response with status code 401, with default header values.
The currently supplied session does not have the correct access rights to request this resource
*/
type ListPostureCheckTypesUnauthorized struct {
Payload *rest_model.APIErrorEnvelope
}
func (o *ListPostureCheckTypesUnauthorized) Error() string {
return fmt.Sprintf("[GET /posture-check-types][%d] listPostureCheckTypesUnauthorized %+v", 401, o.Payload)
}
func (o *ListPostureCheckTypesUnauthorized) GetPayload() *rest_model.APIErrorEnvelope {
return o.Payload
}
func (o *ListPostureCheckTypesUnauthorized) 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
}
@@ -53,6 +53,12 @@ func (o *ListPostureChecksReader) ReadResponse(response runtime.ClientResponse,
return nil, err
}
return result, nil
case 401:
result := NewListPostureChecksUnauthorized()
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())
}
@@ -89,3 +95,35 @@ func (o *ListPostureChecksOK) readResponse(response runtime.ClientResponse, cons
return nil
}
// NewListPostureChecksUnauthorized creates a ListPostureChecksUnauthorized with default headers values
func NewListPostureChecksUnauthorized() *ListPostureChecksUnauthorized {
return &ListPostureChecksUnauthorized{}
}
/* ListPostureChecksUnauthorized describes a response with status code 401, with default header values.
The currently supplied session does not have the correct access rights to request this resource
*/
type ListPostureChecksUnauthorized struct {
Payload *rest_model.APIErrorEnvelope
}
func (o *ListPostureChecksUnauthorized) Error() string {
return fmt.Sprintf("[GET /posture-checks][%d] listPostureChecksUnauthorized %+v", 401, o.Payload)
}
func (o *ListPostureChecksUnauthorized) GetPayload() *rest_model.APIErrorEnvelope {
return o.Payload
}
func (o *ListPostureChecksUnauthorized) 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
}
+244 -2
View File
@@ -117,6 +117,30 @@ func init() {
"schema": {
"$ref": "#/definitions/listApiSessionsEnvelope"
}
},
"401": {
"description": "The currently 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": {
"apiEnrolmentVersion": "0.0.1",
"apiVersion": "0.0.1"
}
}
}
}
}
}
@@ -1023,6 +1047,30 @@ func init() {
"schema": {
"$ref": "#/definitions/listCasEnvelope"
}
},
"401": {
"description": "The currently 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": {
"apiEnrolmentVersion": "0.0.1",
"apiVersion": "0.0.1"
}
}
}
}
}
},
@@ -1779,6 +1827,30 @@ func init() {
"schema": {
"$ref": "#/definitions/listConfigTypesEnvelope"
}
},
"401": {
"description": "The currently 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": {
"apiEnrolmentVersion": "0.0.1",
"apiVersion": "0.0.1"
}
}
}
}
}
},
@@ -8085,6 +8157,30 @@ func init() {
"schema": {
"$ref": "#/definitions/listPostureCheckTypesEnvelope"
}
},
"401": {
"description": "The currently 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": {
"apiEnrolmentVersion": "0.0.1",
"apiVersion": "0.0.1"
}
}
}
}
}
}
@@ -8224,6 +8320,30 @@ func init() {
"schema": {
"$ref": "#/definitions/listPostureCheckEnvelope"
}
},
"401": {
"description": "The currently 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": {
"apiEnrolmentVersion": "0.0.1",
"apiVersion": "0.0.1"
}
}
}
}
}
},
@@ -14244,7 +14364,8 @@ func init() {
"isAutoCaEnrollmentEnabled",
"isOttCaEnrollmentEnabled",
"isAuthEnabled",
"identityRoles"
"identityRoles",
"identityNameFormat"
],
"properties": {
"identityNameFormat": {
@@ -18851,6 +18972,30 @@ func init() {
"schema": {
"$ref": "#/definitions/listApiSessionsEnvelope"
}
},
"401": {
"description": "The currently 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": {
"apiEnrolmentVersion": "0.0.1",
"apiVersion": "0.0.1"
}
}
}
}
}
}
@@ -19757,6 +19902,30 @@ func init() {
"schema": {
"$ref": "#/definitions/listCasEnvelope"
}
},
"401": {
"description": "The currently 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": {
"apiEnrolmentVersion": "0.0.1",
"apiVersion": "0.0.1"
}
}
}
}
}
},
@@ -20513,6 +20682,30 @@ func init() {
"schema": {
"$ref": "#/definitions/listConfigTypesEnvelope"
}
},
"401": {
"description": "The currently 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": {
"apiEnrolmentVersion": "0.0.1",
"apiVersion": "0.0.1"
}
}
}
}
}
},
@@ -26819,6 +27012,30 @@ func init() {
"schema": {
"$ref": "#/definitions/listPostureCheckTypesEnvelope"
}
},
"401": {
"description": "The currently 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": {
"apiEnrolmentVersion": "0.0.1",
"apiVersion": "0.0.1"
}
}
}
}
}
}
@@ -26958,6 +27175,30 @@ func init() {
"schema": {
"$ref": "#/definitions/listPostureCheckEnvelope"
}
},
"401": {
"description": "The currently 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": {
"apiEnrolmentVersion": "0.0.1",
"apiVersion": "0.0.1"
}
}
}
}
}
},
@@ -33068,7 +33309,8 @@ func init() {
"isAutoCaEnrollmentEnabled",
"isOttCaEnrollmentEnabled",
"isAuthEnabled",
"identityRoles"
"identityRoles",
"identityNameFormat"
],
"properties": {
"identityNameFormat": {
@@ -80,3 +80,47 @@ func (o *ListAPISessionsOK) WriteResponse(rw http.ResponseWriter, producer runti
}
}
}
// ListAPISessionsUnauthorizedCode is the HTTP code returned for type ListAPISessionsUnauthorized
const ListAPISessionsUnauthorizedCode int = 401
/*ListAPISessionsUnauthorized The currently supplied session does not have the correct access rights to request this resource
swagger:response listApiSessionsUnauthorized
*/
type ListAPISessionsUnauthorized struct {
/*
In: Body
*/
Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"`
}
// NewListAPISessionsUnauthorized creates ListAPISessionsUnauthorized with default headers values
func NewListAPISessionsUnauthorized() *ListAPISessionsUnauthorized {
return &ListAPISessionsUnauthorized{}
}
// WithPayload adds the payload to the list Api sessions unauthorized response
func (o *ListAPISessionsUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListAPISessionsUnauthorized {
o.Payload = payload
return o
}
// SetPayload sets the payload to the list Api sessions unauthorized response
func (o *ListAPISessionsUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) {
o.Payload = payload
}
// WriteResponse to the client
func (o *ListAPISessionsUnauthorized) 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
}
}
}
@@ -80,3 +80,47 @@ func (o *ListCasOK) WriteResponse(rw http.ResponseWriter, producer runtime.Produ
}
}
}
// ListCasUnauthorizedCode is the HTTP code returned for type ListCasUnauthorized
const ListCasUnauthorizedCode int = 401
/*ListCasUnauthorized The currently supplied session does not have the correct access rights to request this resource
swagger:response listCasUnauthorized
*/
type ListCasUnauthorized struct {
/*
In: Body
*/
Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"`
}
// NewListCasUnauthorized creates ListCasUnauthorized with default headers values
func NewListCasUnauthorized() *ListCasUnauthorized {
return &ListCasUnauthorized{}
}
// WithPayload adds the payload to the list cas unauthorized response
func (o *ListCasUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListCasUnauthorized {
o.Payload = payload
return o
}
// SetPayload sets the payload to the list cas unauthorized response
func (o *ListCasUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) {
o.Payload = payload
}
// WriteResponse to the client
func (o *ListCasUnauthorized) 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
}
}
}
@@ -80,3 +80,47 @@ func (o *ListConfigTypesOK) WriteResponse(rw http.ResponseWriter, producer runti
}
}
}
// ListConfigTypesUnauthorizedCode is the HTTP code returned for type ListConfigTypesUnauthorized
const ListConfigTypesUnauthorizedCode int = 401
/*ListConfigTypesUnauthorized The currently supplied session does not have the correct access rights to request this resource
swagger:response listConfigTypesUnauthorized
*/
type ListConfigTypesUnauthorized struct {
/*
In: Body
*/
Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"`
}
// NewListConfigTypesUnauthorized creates ListConfigTypesUnauthorized with default headers values
func NewListConfigTypesUnauthorized() *ListConfigTypesUnauthorized {
return &ListConfigTypesUnauthorized{}
}
// WithPayload adds the payload to the list config types unauthorized response
func (o *ListConfigTypesUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListConfigTypesUnauthorized {
o.Payload = payload
return o
}
// SetPayload sets the payload to the list config types unauthorized response
func (o *ListConfigTypesUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) {
o.Payload = payload
}
// WriteResponse to the client
func (o *ListConfigTypesUnauthorized) 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
}
}
}
@@ -80,3 +80,47 @@ func (o *ListPostureCheckTypesOK) WriteResponse(rw http.ResponseWriter, producer
}
}
}
// ListPostureCheckTypesUnauthorizedCode is the HTTP code returned for type ListPostureCheckTypesUnauthorized
const ListPostureCheckTypesUnauthorizedCode int = 401
/*ListPostureCheckTypesUnauthorized The currently supplied session does not have the correct access rights to request this resource
swagger:response listPostureCheckTypesUnauthorized
*/
type ListPostureCheckTypesUnauthorized struct {
/*
In: Body
*/
Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"`
}
// NewListPostureCheckTypesUnauthorized creates ListPostureCheckTypesUnauthorized with default headers values
func NewListPostureCheckTypesUnauthorized() *ListPostureCheckTypesUnauthorized {
return &ListPostureCheckTypesUnauthorized{}
}
// WithPayload adds the payload to the list posture check types unauthorized response
func (o *ListPostureCheckTypesUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListPostureCheckTypesUnauthorized {
o.Payload = payload
return o
}
// SetPayload sets the payload to the list posture check types unauthorized response
func (o *ListPostureCheckTypesUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) {
o.Payload = payload
}
// WriteResponse to the client
func (o *ListPostureCheckTypesUnauthorized) 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
}
}
}
@@ -80,3 +80,47 @@ func (o *ListPostureChecksOK) WriteResponse(rw http.ResponseWriter, producer run
}
}
}
// ListPostureChecksUnauthorizedCode is the HTTP code returned for type ListPostureChecksUnauthorized
const ListPostureChecksUnauthorizedCode int = 401
/*ListPostureChecksUnauthorized The currently supplied session does not have the correct access rights to request this resource
swagger:response listPostureChecksUnauthorized
*/
type ListPostureChecksUnauthorized struct {
/*
In: Body
*/
Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"`
}
// NewListPostureChecksUnauthorized creates ListPostureChecksUnauthorized with default headers values
func NewListPostureChecksUnauthorized() *ListPostureChecksUnauthorized {
return &ListPostureChecksUnauthorized{}
}
// WithPayload adds the payload to the list posture checks unauthorized response
func (o *ListPostureChecksUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListPostureChecksUnauthorized {
o.Payload = payload
return o
}
// SetPayload sets the payload to the list posture checks unauthorized response
func (o *ListPostureChecksUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) {
o.Payload = payload
}
// WriteResponse to the client
func (o *ListPostureChecksUnauthorized) 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
}
}
}
+15 -1
View File
@@ -44,7 +44,8 @@ import (
type CaUpdate struct {
// identity name format
IdentityNameFormat string `json:"identityNameFormat,omitempty"`
// Required: true
IdentityNameFormat *string `json:"identityNameFormat"`
// identity roles
// Required: true
@@ -78,6 +79,10 @@ type CaUpdate struct {
func (m *CaUpdate) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateIdentityNameFormat(formats); err != nil {
res = append(res, err)
}
if err := m.validateIdentityRoles(formats); err != nil {
res = append(res, err)
}
@@ -108,6 +113,15 @@ func (m *CaUpdate) Validate(formats strfmt.Registry) error {
return nil
}
func (m *CaUpdate) validateIdentityNameFormat(formats strfmt.Registry) error {
if err := validate.Required("identityNameFormat", "body", m.IdentityNameFormat); err != nil {
return err
}
return nil
}
func (m *CaUpdate) validateIdentityRoles(formats strfmt.Registry) error {
if err := validate.Required("identityRoles", "body", m.IdentityRoles); err != nil {
+19
View File
@@ -347,6 +347,25 @@ paths:
description: A list of the current API Session's certificate
schema:
$ref: '#/definitions/listCurrentApiSessionCertificatesEnvelope'
"401":
description: The currently 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:
apiEnrolmentVersion: 0.0.1
apiVersion: 0.0.1
post:
security:
- ztSession: []
+96
View File
@@ -52,6 +52,25 @@ paths:
description: A list of active API Sessions
schema:
$ref: '#/definitions/listApiSessionsEnvelope'
"401":
description: The currently 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:
apiEnrolmentVersion: 0.0.1
apiVersion: 0.0.1
/api-sessions/{id}:
get:
security:
@@ -701,6 +720,25 @@ paths:
description: A list of Certificate Authorities (CAs)
schema:
$ref: '#/definitions/listCasEnvelope'
"401":
description: The currently 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:
apiEnrolmentVersion: 0.0.1
apiVersion: 0.0.1
post:
security:
- ztSession: []
@@ -1256,6 +1294,25 @@ paths:
description: A list of config-types
schema:
$ref: '#/definitions/listConfigTypesEnvelope'
"401":
description: The currently 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:
apiEnrolmentVersion: 0.0.1
apiVersion: 0.0.1
post:
security:
- ztSession: []
@@ -5800,6 +5857,25 @@ paths:
description: A list of posture check types
schema:
$ref: '#/definitions/listPostureCheckTypesEnvelope'
"401":
description: The currently 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:
apiEnrolmentVersion: 0.0.1
apiVersion: 0.0.1
/posture-check-types/{id}:
get:
security:
@@ -5893,6 +5969,25 @@ paths:
description: A list of posture checks
schema:
$ref: '#/definitions/listPostureCheckEnvelope'
"401":
description: The currently 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:
apiEnrolmentVersion: 0.0.1
apiVersion: 0.0.1
post:
security:
- ztSession: []
@@ -10220,6 +10315,7 @@ definitions:
- isOttCaEnrollmentEnabled
- isAuthEnabled
- identityRoles
- identityNameFormat
properties:
identityNameFormat:
type: string
@@ -16,6 +16,8 @@ paths:
responses:
'200':
$ref: '#/responses/listCurrentApiSessionCertificates'
'401':
$ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse'
post:
summary: Creates an ephemeral certificate for the current API Session
description: Creates an ephemeral certificate for the current API Session. This endpoint
+2
View File
@@ -21,6 +21,8 @@ paths:
responses:
'200':
$ref: '#/responses/listAPISessions'
'401':
$ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse'
api-sessions-id:
parameters:
- $ref: '../shared/parameters.yml#/id'
+3
View File
@@ -16,6 +16,8 @@ paths:
responses:
'200':
$ref: '#/responses/listCas'
'401':
$ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse'
post:
summary: Creates a CA
description: Creates a CA in an unverified state. Requires admin access.
@@ -317,6 +319,7 @@ definitions:
- isOttCaEnrollmentEnabled
- isAuthEnabled
- identityRoles
- identityNameFormat
properties:
name:
type: string
+2
View File
@@ -17,6 +17,8 @@ paths:
responses:
'200':
$ref: '#/responses/listConfigTypes'
'401':
$ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse'
post:
summary: Create a config-type. Requires admin access.
security:
@@ -19,6 +19,8 @@ paths:
responses:
'200':
$ref: '#/responses/listPostureCheckTypes'
'401':
$ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse'
posture-check-types-id:
parameters:
- $ref: '../shared/parameters.yml#/id'
@@ -21,6 +21,8 @@ paths:
responses:
'200':
$ref: '#/responses/listPostureChecks'
'401':
$ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse'
post:
summary: Creates a Posture Checks
description: Creates a Posture Checks
+12
View File
@@ -41,6 +41,18 @@ func Test_CA(t *testing.T) {
ctx.AdminManagementSession.validateEntityWithLookup(ca)
})
t.Run("identityNameFormat should be updated", func(t *testing.T) {
ctx.testContextChanged(t)
role1 := eid.New()
role2 := eid.New()
ca := newTestCa(role1, role2)
ca.id = ctx.AdminManagementSession.requireCreateEntity(ca)
ca.identityNameFormat = "123"
ctx.AdminManagementSession.requireUpdateEntity(ca)
ctx.AdminManagementSession.validateEntityWithLookup(ca)
})
t.Run("identity name format should default if not specified", func(t *testing.T) {
ctx.testContextChanged(t)
role1 := eid.New()