Commit Graph

39 Commits

Author SHA1 Message Date
Max Ehrlich
bbd9249198 Configurable issuer duration and renewBefore Take 2 (#893)
* Configurable issuer duration and renewBefore [1/3]

This is part one of (probably) three parts manually moving the changes from commit 723015174a167d746323f506ab3575cfb243d8bd to the new master. This commit moves the basic functionality of configurable duration while skipping e2e tests and docs. It does not include new work.

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Configurable issuer duration and renewBefore [2/3]

This commit moves over most of the e2e testing updates, some things are intentionally left out as they may be obsolete

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Configurable issuer duration and renewBefore [3/3]

This commit moves the documentation changes, completely the migration of the original code to the latest master

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Rerunning all hack scripts with since the massive bazel update

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Add missing boilerplate headers

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Rerun codegen hack

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Rerunning update-docs hack

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Fix failing unit tests

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Fix build errors in e2e tests

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Rerun update-deps

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Don't recreate the CA issuer, it already exists

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Need to create new issuers for the duration and renew time tests because those fields are set in the issuer, so make sure they are named uniquely

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Add duration e2e tests for self-signed issuer

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Add duration e2e tests for vault w/ custom mount path

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Add validation to disallow acme certificates with duration and renewBefore set and update unit tests to verify

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Update docs to mention duration/renew for self-signed issuer and fix potential parsing errors with rst formatting

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Self-signed issuer was missing duration validation

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Fix a bug causing certificates with a short enough renew-before w.r.t their duration to be renewed instantly and forever

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Print the exact time until renewal

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Move duration and renwal validation to the issuer validation

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Update e2e tests to work with new validation

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Add e2e test for the self-signed issuer

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Redo cert duration and renew before to appear as part of the CSR and not the issuer

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Updating tests to match new duration/renewbefore format

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Update e2e tests to match new format

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Update docs to reflect changing the field from issuers to certificates

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Remove event firing and replace with a TODO as of discussion on PR

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Run hack scripts

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Remove the sync unit test since without events there is no way to catch the warnings that it was testing

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Use IssuerOptions RenewBeforeExpiryDuration if certificates dont set a renewBefore value for immediate renewal checks

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Delete check on certificate data length in e2e test for certificate duration as there is no reason it should be there

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Update e2e tests since certificate creation will never generate an event

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Rerunning hack scripts after big rebase

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Fix a few problems that slipped through during the rebase

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Fix an e2e error that resulted from the rebase

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Add unit test for the calculateTimeBeforeExpiry function

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Adding back in a bunch of missing error checks

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Remove unused function

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Add missing boilerplate

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Remove unused constant

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Move log constants to function body

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Rerun hack scripts

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Remove mistakenly commited file

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Remove double-import of util package

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Fix bad function call in e2e vault issuer

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Change duration and renewBefore to be pointer fields as they are optional

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Remove wrong vault issuer test that got passed the rebase somehow

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Change e2e to use pointer format

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Move e2e cert tests out of issuer test file

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Move e2e self-signed issuer test to new location

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Make sure to check for nil in GenerateTemplate

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Add more empty checks to be safe

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Rerunning hacks after rebase

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Fix bad function call in new e2e test

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Try not setting duration and renewbefore on acme e2e tests

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Zero checks should really just be replaced by nil tests, zero should be caught as any other too-small value

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Fixed a missing nil check that got away

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Change e2e duration test format to use pointer times to better simulate API calls

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Fix sync unit test to match e2e test format

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Fix vault e2e test

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Revert changes to Certificate sync function

Signed-off-by: James Munnelly <james@munnelly.eu>

* Remove selfsigned e2e issuer.go

Signed-off-by: James Munnelly <james@munnelly.eu>

* Don't use ACME issuer in duration example and tidy up line endings

Signed-off-by: James Munnelly <james@munnelly.eu>

* Allow renewBefore to be set on ACME certificates

Signed-off-by: James Munnelly <james@munnelly.eu>

* Update renewBefore ACME docs. Remove unused fields.

Signed-off-by: James Munnelly <james@munnelly.eu>

* Rename calculateTimeBeforeExpiry to calculateDurationUntilRenew

Signed-off-by: James Munnelly <james@munnelly.eu>
2018-11-14 22:30:00 +00:00
James Munnelly
efe2129c69 Run //hack:update-reference-docs
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-11-06 12:32:05 +00:00
Zadkiel Aharonian
7f8a3a7970
regenerate
Signed-off-by: Zadkiel Aharonian <hello@zadkiel.fr>
2018-10-23 16:27:30 +02:00
James Munnelly
e9441e6fdc Run //hack:update-reference-docs
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-10-23 10:59:31 +01:00
James Munnelly
4a9de511b3 Run all docs generation with Bazel
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-10-23 02:15:26 +01:00
jetstack-bot
54d8ef7e8a
Merge pull request #911 from vdesjardins/vault-ca-bundle
vault ca bundle support
2018-10-12 15:06:39 +01:00
James Munnelly
2454dfa76f Regenerate reference docs
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-10-12 14:09:43 +01:00
James Munnelly
4eb48b9c04 run //hack:update-reference-docs
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-10-12 12:40:37 +01:00
James Munnelly
2eb785655c Run //hack:update-codegen
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-10-12 12:40:37 +01:00
Vincent Desjardins
4e89b611cf missing omitempty for CABundle field in Vault issuer
Signed-off-by: Vincent Desjardins <vdesjardins@gmail.com>
2018-10-12 11:14:08 +00:00
Vincent Desjardins
92ac7a7c08 code review updates
Signed-off-by: Vincent Desjardins <vdesjardins@gmail.com>
2018-10-11 01:22:05 +00:00
Vincent Desjardins
7c1ff275f0 vault ca bundle support
Signed-off-by: Vincent Desjardins <vdesjardins@gmail.com>
2018-10-11 01:22:05 +00:00
Arnold Bechtoldt
ce1dd5e8b5 update API docs
Signed-off-by: Arnold Bechtoldt <arnold.bechtoldt@inovex.de>
2018-10-10 13:31:07 +02:00
Arnold Bechtoldt
c533390185 completely rename setting name in generated docs too
Signed-off-by: Arnold Bechtoldt <arnold.bechtoldt@inovex.de>
2018-10-08 15:30:51 +02:00
Arnold Bechtoldt
d261e1f3f1 make serviceType configurable, fixes #928
Signed-off-by: Arnold Bechtoldt <arnold.bechtoldt@inovex.de>
2018-10-08 10:55:56 +02:00
James Munnelly
c48018c1a1 run //hack:update-reference-docs
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-09-13 11:25:04 +01:00
James Munnelly
5e16dd47ab Run brodocs using bazel
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-09-13 11:25:03 +01:00
James Munnelly
38078cf5cd Commit openapi_generated.go
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-09-13 11:25:02 +01:00
James Munnelly
e7677f3656 Update update-codegen to run openapi-gen
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-09-13 11:24:53 +01:00
James Munnelly
db65d6a170 run //hack:update-bazel
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-09-13 11:24:48 +01:00
jetstack-bot
feb589feb5
Merge pull request #661 from splashx/master
[ACME] Add RFC2136 DNS Provider (2nd attempt)
2018-09-12 09:11:48 +01:00
splashx
51a8a57221
add tests for nameserver, tsigsecret and tsigname
Signed-off-by: splashx <splash@gmail.com>
2018-09-10 20:03:32 +02:00
Max Ehrlich
f9b4b04448
Rerun hack script generators
Signed-off-by: Max Ehrlich <max.ehr@gmail.com>
2018-09-08 16:21:14 -04:00
Max Ehrlich
858f92d698
Regenerate docs and show setting organization in the CA example
Signed-off-by: Max Ehrlich <max.ehr@gmail.com>
2018-09-08 16:21:13 -04:00
splashx
41111f7879
patch with rfc2136
Signed-off-by: splashx <splash@gmail.com>
2018-09-07 00:56:00 +02:00
James Munnelly
ae122766fb Regenerate reference docs
Signed-off-by: James Munnelly <james.munnelly@jetstack.io>
2018-08-20 12:36:36 +01:00
jetstack-bot
972f86704d
Merge pull request #787 from Queuecumber/master
Add ACME-DNS as a DNS-01 Provider
2018-08-17 13:33:57 +01:00
James Munnelly
5ea2c6843e Regenerate reference docs
Signed-off-by: James Munnelly <james.munnelly@jetstack.io>
2018-08-14 10:32:50 +01:00
Max Ehrlich
b1eadabf42
Change wording from "accounts" to "account"
Signed-off-by: Max Ehrlich <max.ehr@gmail.com>
2018-08-13 13:32:14 -04:00
Max Ehrlich
9a0b1d8f56
Docs needed more updating
Signed-off-by: Max Ehrlich <max.ehr@gmail.com>
2018-08-13 13:32:14 -04:00
Max Ehrlich
f7a42fb9fd
Add acme-dns issuer config to the issuer definition and update docs
Signed-off-by: Max Ehrlich <max.ehr@gmail.com>
2018-08-13 13:30:33 -04:00
Max Ehrlich
9902845c82
Add acmedns constructor to dns interface
Signed-off-by: Max Ehrlich <max.ehr@gmail.com>
2018-08-13 13:30:33 -04:00
James Munnelly
51195e4c5f Update license header and add header to every file
Signed-off-by: James Munnelly <james.munnelly@jetstack.io>
2018-08-13 15:53:37 +01:00
James Munnelly
3e95b9410c Update generated files 2018-08-07 14:16:49 +01:00
jetstack-bot
6348c6ffca
Merge pull request #722 from autonomic-ai/support-ec-keys
Add keyAlgorithm and keySize fields to Certificates, and support ECDSA keys
2018-07-18 10:00:36 +01:00
Afolabi Badmos
445e522432 Add support for EC keys
- This PR adds two fields to CertificateSpec:
  - `keyAlgorithm`, denotes which algorithm to use when generating
    a private key. Can be either `rsa` or `ecdsa`. When not set, the
    default algorithm used `rsa`.
  - `keySize`, denotes the key size of the private key being generated.
    For `rsa`, minimum key size is 2048 and maximum is 8192.
    For `ecdsa`, sizes 224, 256, 384 & 521 are supported.
    See https://golang.org/pkg/crypto/elliptic

- `keySize` can be set without being explicit about `keyAlgorithm`.
  - If `keySize` is specified and `keyAlgorithm` is not provided, `rsa` will
    be used as the key algorithm.

- `keyAlgorithm` can be set without being explicit about `keySize`.
  - If `keyAlgorithm` is specified and `keySize` is not provided, key size
    key size of `256` will be used for `ecdsa` key algorithm and
    key size of `2048` will be used for `rsa` key algorithm.

- helper functions in `pki` package now return crypto.PrivateKey
2018-07-17 12:42:07 -04:00
test@test.com
cb7eaf986f Run hack/update-reference-docs.sh 2018-07-11 16:02:23 +00:00
James Munnelly
95000f1937 Run hack/update-reference-docs-dockerized.sh 2018-07-05 14:47:36 +01:00
James Munnelly
2014183a57 Add script for generating reference docs 2018-07-05 14:47:32 +01:00