Skip to content

Commit

Permalink
Merge pull request #37 from dinghram/unbreakswaggo
Browse files Browse the repository at this point in the history
unbreak swaggo doc generation for Identity object
  • Loading branch information
necheffa authored Apr 13, 2024
2 parents d421ccc + 1949d4d commit 26217b0
Show file tree
Hide file tree
Showing 4 changed files with 227 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ca.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type Identity struct {
Province string `json:"province" example:"Veldhoven"` // Province name
EmailAddresses string `json:"email" example:"sec@company.com"` // Email Address
DNSNames []string `json:"dns_names" example:"ca.example.com,root-ca.example.com"` // DNS Names list
IPAddresses []net.IP `json:"ip_addresses,omitempty" example:"127.0.0.1,192.168.0.1"` // IP Address list
IPAddresses []net.IP `json:"ip_addresses,omitempty"` // IP Address list
Intermediate bool `json:"intermediate" example:"false"` // Intermendiate Certificate Authority (default is false)
KeyBitSize int `json:"key_size" example:"2048"` // Key Bit Size (defaul: 2048)
Valid int `json:"valid" example:"365"` // Minimum 1 day, maximum 825 days -- Default: 397
Expand Down
71 changes: 71 additions & 0 deletions docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,77 @@ const docTemplate = `{
}
}
},
"goca.Identity": {
"type": "object",
"properties": {
"country": {
"description": "Country (two letters)",
"type": "string",
"example": "NL"
},
"dns_names": {
"description": "DNS Names list",
"type": "array",
"items": {
"type": "string"
},
"example": [
"ca.example.com",
"root-ca.example.com"
]
},
"email": {
"description": "Email Address",
"type": "string",
"example": "sec@company.com"
},
"intermediate": {
"description": "Intermendiate Certificate Authority (default is false)",
"type": "boolean",
"example": false
},
"ip_addresses": {
"description": "IP Address list",
"type": "array",
"items": {
"type": "array",
"items": {
"type": "integer"
}
}
},
"key_size": {
"description": "Key Bit Size (defaul: 2048)",
"type": "integer",
"example": 2048
},
"locality": {
"description": "Locality name",
"type": "string",
"example": "Noord-Brabant"
},
"organization": {
"description": "Organization name",
"type": "string",
"example": "Company"
},
"organization_unit": {
"description": "Organizational Unit name",
"type": "string",
"example": "Security Management"
},
"province": {
"description": "Province name",
"type": "string",
"example": "Veldhoven"
},
"valid": {
"description": "Minimum 1 day, maximum 825 days -- Default: 397",
"type": "integer",
"example": 365
}
}
},
"models.CABody": {
"type": "object",
"properties": {
Expand Down
90 changes: 89 additions & 1 deletion docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,77 @@
}
}
},
"goca.Identity": {
"type": "object",
"properties": {
"country": {
"description": "Country (two letters)",
"type": "string",
"example": "NL"
},
"dns_names": {
"description": "DNS Names list",
"type": "array",
"items": {
"type": "string"
},
"example": [
"ca.example.com",
"root-ca.example.com"
]
},
"email": {
"description": "Email Address",
"type": "string",
"example": "sec@company.com"
},
"intermediate": {
"description": "Intermendiate Certificate Authority (default is false)",
"type": "boolean",
"example": false
},
"ip_addresses": {
"description": "IP Address list",
"type": "array",
"items": {
"type": "array",
"items": {
"type": "integer"
}
}
},
"key_size": {
"description": "Key Bit Size (defaul: 2048)",
"type": "integer",
"example": 2048
},
"locality": {
"description": "Locality name",
"type": "string",
"example": "Noord-Brabant"
},
"organization": {
"description": "Organization name",
"type": "string",
"example": "Company"
},
"organization_unit": {
"description": "Organizational Unit name",
"type": "string",
"example": "Security Management"
},
"province": {
"description": "Province name",
"type": "string",
"example": "Veldhoven"
},
"valid": {
"description": "Minimum 1 day, maximum 825 days -- Default: 397",
"type": "integer",
"example": 365
}
}
},
"models.CABody": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -522,7 +593,24 @@
}
},
"models.Payload": {
"type": "object"
"type": "object",
"required": [
"common_name",
"identity"
],
"properties": {
"common_name": {
"type": "string",
"example": "root-ca"
},
"identity": {
"$ref": "#/definitions/goca.Identity"
},
"parent_common_name": {
"type": "string",
"example": "root-ca"
}
}
},
"models.ResponseCA": {
"type": "object",
Expand Down
66 changes: 66 additions & 0 deletions docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,60 @@ definitions:
-----BEGIN PUBLIC KEY-----...-----END PUBLIC KEY-----
type: string
type: object
goca.Identity:
properties:
country:
description: Country (two letters)
example: NL
type: string
dns_names:
description: DNS Names list
example:
- ca.example.com
- root-ca.example.com
items:
type: string
type: array
email:
description: Email Address
example: sec@company.com
type: string
intermediate:
description: Intermendiate Certificate Authority (default is false)
example: false
type: boolean
ip_addresses:
description: IP Address list
items:
items:
type: integer
type: array
type: array
key_size:
description: 'Key Bit Size (defaul: 2048)'
example: 2048
type: integer
locality:
description: Locality name
example: Noord-Brabant
type: string
organization:
description: Organization name
example: Company
type: string
organization_unit:
description: Organizational Unit name
example: Security Management
type: string
province:
description: Province name
example: Veldhoven
type: string
valid:
description: 'Minimum 1 day, maximum 825 days -- Default: 397'
example: 365
type: integer
type: object
models.CABody:
properties:
certificates:
Expand Down Expand Up @@ -128,6 +182,18 @@ definitions:
type: string
type: object
models.Payload:
properties:
common_name:
example: root-ca
type: string
identity:
$ref: '#/definitions/goca.Identity'
parent_common_name:
example: root-ca
type: string
required:
- common_name
- identity
type: object
models.ResponseCA:
properties:
Expand Down

0 comments on commit 26217b0

Please sign in to comment.