add expiresAt to ottca

This commit is contained in:
Andrew M
2020-07-01 10:23:15 -04:00
parent b6a7843a5a
commit ef82289db9
4 changed files with 37 additions and 0 deletions
@@ -224,6 +224,7 @@ func MapIdentityToRestModel(ae *env.AppEnv, identity *model.Identity) (*rest_mod
CaID: ca.Id,
Jwt: entity.Jwt,
Token: entity.Token,
ExpiresAt: expiresAt,
}
}
+21
View File
@@ -217,6 +217,10 @@ type IdentityEnrollmentsOttca struct {
// ca Id
CaID string `json:"caId,omitempty"`
// expires at
// Format: date-time
ExpiresAt strfmt.DateTime `json:"expiresAt,omitempty"`
// jwt
Jwt string `json:"jwt,omitempty"`
@@ -232,6 +236,10 @@ func (m *IdentityEnrollmentsOttca) Validate(formats strfmt.Registry) error {
res = append(res, err)
}
if err := m.validateExpiresAt(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
@@ -256,6 +264,19 @@ func (m *IdentityEnrollmentsOttca) validateCa(formats strfmt.Registry) error {
return nil
}
func (m *IdentityEnrollmentsOttca) validateExpiresAt(formats strfmt.Registry) error {
if swag.IsZero(m.ExpiresAt) { // not required
return nil
}
if err := validate.FormatOf("ottca"+"."+"expiresAt", "body", "date-time", m.ExpiresAt.String(), formats); err != nil {
return err
}
return nil
}
// MarshalBinary interface implementation
func (m *IdentityEnrollmentsOttca) MarshalBinary() ([]byte, error) {
if m == nil {
+12
View File
@@ -6248,6 +6248,10 @@ func init() {
"caId": {
"type": "string"
},
"expiresAt": {
"type": "string",
"format": "date-time"
},
"jwt": {
"type": "string"
},
@@ -20135,6 +20139,10 @@ func init() {
"caId": {
"type": "string"
},
"expiresAt": {
"type": "string",
"format": "date-time"
},
"jwt": {
"type": "string"
},
@@ -21885,6 +21893,10 @@ func init() {
"caId": {
"type": "string"
},
"expiresAt": {
"type": "string",
"format": "date-time"
},
"jwt": {
"type": "string"
},
+3
View File
@@ -3782,6 +3782,9 @@ definitions:
type: string
ca:
$ref: '#/definitions/entityRef'
expiresAt:
type: string
format: date-time
###################################################################
# Authenticator
##################################################################