boulder/test
Daniel McCarney 27d531101f Store new authorizations in the `authz` table (#2219)
To remove challenges with expired/pending authz's when they are deleted we want to introduce a foreign key relationship to the challenges table's authorizationID field with instruction to cascade on delete (#2155). As pointed out in a comment this is made difficult by the current usage of a separate pendingAuthorizations table for pending authorizations.

To be able to remove the pendingAuthorizations table entirely (#2163) we need to first stop using it. This PR introduces the code changes required to achieve this.

Notes:

The SA's NewPendingAuthorization function was updated to store all new pending auths in the authz table and to ensure the status is StatusPending.
The SA's GetAuthorization, UpdatePendingAuthorization, FinalizeAuthorization, and RevokeAuthorizationsByDomain functions were updated to properly handle the fact that a pending authz could be in either the pendingAuthorizations table, or the authz table, and to do the right thing accordingly.
Several places in the RA unit tests created a pending authorization with a status "Valid", then finalized it later. This broke when NewPendingAuthorization was changed to enforce Pending status before creating the authz row since the FinalizeAuthorization code expected to only finalize Valid rows. To fix this some of the RA unit tests were changed to explicitly set status to Valid before calling FinalizeAuthorization. This matches the true intention of the tests to quickly create a pending & then finalized authorization.
The expired-authz-purger utility was updated to purge from both the pendingAuthorizations and authz table as required.
The return values of RevokeAuthorizationsByDomain have changed slightly. Previously it returned a 2 element array where the first element was the number of pending authorizations revoked and the second element was the number of finalized authorizations revoked. This is changed so that now it is the number of rows from the pendingAuthorizations and authz tables respectively. E.g. the second count for the authz table may now include non-finalized authzs in its count of affected rows. The admin-revoker is the only place that used this SA method and it was updated appropriately to describe the "rows" change.
The "purger" database user needs to have a new GRANT SELECT, DELETE for the authz table in addition to its existing GRANT for the pendingAuthorizations table.
This resolves #2162
2016-10-18 09:39:59 -07:00
..
boulder-tools Very basic feature flag impl (#1705) 2016-09-20 16:29:01 -07:00
config Adds `notafter-backfiller` cmd. (#2227) 2016-10-11 14:38:40 -07:00
config-next Adds `notafter-backfiller` cmd. (#2227) 2016-10-11 14:38:40 -07:00
ct-test-srv Remove all stray copyright headers and appends the initial line to LICENSE.txt (#1853) 2016-05-31 12:32:04 -07:00
dns-test-srv Remove all stray copyright headers and appends the initial line to LICENSE.txt (#1853) 2016-05-31 12:32:04 -07:00
grpc-creds Split CAA checking out to its own service (#1647) 2016-04-12 23:02:41 -07:00
js Remove inquirer from test.js. (#1994) 2016-06-30 10:58:57 -07:00
mail-test-srv Allow `mailer` to reconnect to server. (#2101) 2016-08-15 14:14:49 -07:00
secrets Adds `notafter-backfiller` cmd. (#2227) 2016-10-11 14:38:40 -07:00
vars always use boulder-mysql, not localhost, for mysql 2016-04-07 10:19:24 +02:00
caa-servfail-exceptions.txt Add enforcement for CAA SERVFAIL (#1971) 2016-06-28 11:00:23 -07:00
cfssl-config.json Move cert-csr check to boulder/core and review fixes 2015-06-02 17:56:28 +01:00
create_db.sh Local DB migration improvements (`-next` directory, auto-migrate) (#2206) 2016-09-26 21:37:05 -07:00
ct-key.pem Use a EC key to sign CT signatures, plus properly load it 2015-12-15 13:50:43 -08:00
db-common.sh * Delete Policy DB.This is no longer needed now that we have a JSON policy file.* Fix tests.* Revert Dockerfile.* Fix create_db* Simplify user addition.* Fix tests.* Fix tests* Review fixes.https://github.com/letsencrypt/boulder/pull/1773 2016-04-29 12:12:24 -07:00
db.go * Delete Policy DB.This is no longer needed now that we have a JSON policy file.* Fix tests.* Revert Dockerfile.* Fix create_db* Simplify user addition.* Fix tests.* Fix tests* Review fixes.https://github.com/letsencrypt/boulder/pull/1773 2016-04-29 12:12:24 -07:00
docker-environment Switch to Golang 1.6.3 (#2105) 2016-08-05 16:35:43 -04:00
drop_users.sql Add cmd/expired-authz-purger (#1828) 2016-06-03 16:00:19 -04:00
entrypoint.sh Improve single-ocsp command (#2181) 2016-09-15 15:28:54 -07:00
example-expiration-template Review fixes 2015-07-27 12:46:09 -07:00
hostname-policy.json * Delete Policy DB.This is no longer needed now that we have a JSON policy file.* Fix tests.* Revert Dockerfile.* Fix create_db* Simplify user addition.* Fix tests.* Fix tests* Review fixes.https://github.com/letsencrypt/boulder/pull/1773 2016-04-29 12:12:24 -07:00
integration-test.py Fix non-Docker integration test. (#2184) 2016-09-16 18:21:33 -07:00
issuer-ocsp-responder.json Improve single-ocsp command (#2181) 2016-09-15 15:28:54 -07:00
make-softhsm.sh Fix non-Docker integration test. (#2184) 2016-09-16 18:21:33 -07:00
migrate-up.sh Add a test that there are no outdated migrations. 2015-09-18 14:53:40 -07:00
rate-limit-policies-b.yml Add certificatesPerName rate limit to integration test (#1940) 2016-06-17 16:10:05 -07:00
rate-limit-policies.yml Add certificatesPerName rate limit to integration test (#1940) 2016-06-17 16:10:05 -07:00
run-docker.sh Roll forward "Run Travis tests in Docker (#1830)" (#1838) 2016-05-24 15:11:22 -07:00
sa_db_users.sql Store new authorizations in the `authz` table (#2219) 2016-10-18 09:39:59 -07:00
setup.sh Very basic feature flag impl (#1705) 2016-09-20 16:29:01 -07:00
startservers.py Improve single-ocsp command (#2181) 2016-09-15 15:28:54 -07:00
test-ca.der Unflake OCSP integration test 2015-10-21 14:38:15 -07:00
test-ca.key Make it easier to start a test config. 2015-04-09 18:26:40 -07:00
test-ca.key-pkcs11.json Improve single-ocsp command (#2181) 2016-09-15 15:28:54 -07:00
test-ca.key.der Add DER form of test-ca key in-tree. (#2041) 2016-07-12 09:06:59 -07:00
test-ca.pem Unflake OCSP integration test 2015-10-21 14:38:15 -07:00
test-ca2.pem Add multi-issuer support to the CA. 2016-03-21 20:56:58 -07:00
test-no-outdated-migrations.sh Fix mktemp to be MacOS compatible 2015-09-23 13:16:16 -07:00
test-root.key Unflake OCSP integration test 2015-10-21 14:38:15 -07:00
test-root.key-pkcs11.json Improve single-ocsp command (#2181) 2016-09-15 15:28:54 -07:00
test-root.key.der Improve single-ocsp command (#2181) 2016-09-15 15:28:54 -07:00
test-root.pem Unflake OCSP integration test 2015-10-21 14:38:15 -07:00
test-tools.go Change `%v` to `%#v` in AssertEquals error msg. (#1983) 2016-06-28 08:42:51 -07:00
travis-before-install.sh Run travis-before-install once more. (#1858) 2016-05-31 14:06:02 -07:00