Commit Graph

137 Commits

Author SHA1 Message Date
Jeff Hodges 5e97aa23c6 use MariaDB in the unit tests
And delete the uses of sqlite3
2015-08-14 17:13:15 -07:00
Roland Shoemaker 6cae3f27ce Merge pull request #620 from letsencrypt/always_set_parse_time
always set parseTime to true
2015-08-14 10:52:45 -07:00
Jeff Hodges ae5fa728ea always set parseTime to true
There's no reason to not just enforce it in the code completely and not
worry about it elsewhere. If we need to extract code out of NewDbMap,
we'd need recombineURLForDB in it, anyhow.
2015-08-13 22:45:33 -07:00
Jeff Hodges b701cb60ce Merge pull request #605 from letsencrypt/rm-jsonbuffer
Remove JSONBuffer from TypeConverter.
2015-08-13 17:44:59 -07:00
Jacob Hoffman-Andrews 8c89e6db8c Remove JSONBuffer from TypeConverter. 2015-08-11 22:55:37 -07:00
Jacob Hoffman-Andrews 64987a3639 Merge pull request #599 from letsencrypt/mysql
use MariaDB in integration tests and start.py
2015-08-11 20:31:46 -07:00
Jeff Hodges 86390e312b require mysql+tcp:// as the scheme for db conns 2015-08-11 20:17:35 -07:00
Jacob Hoffman-Andrews 4d8367bc0e Remove logging of dbConnect string.
This can accidentally put passwords in logs.
2015-08-11 12:32:10 -07:00
Jeff Hodges 7f44d22604 use URL.Path until TravisCI gets 1.5
Either we'll figure out how to get it added or they will.
2015-08-08 02:08:47 -07:00
Jeff Hodges 42a626f9fc fix comment about db URLs and trim dbConnect 2015-08-07 23:30:01 -07:00
Jeff Hodges b08e6e0bad use MariaDB in integration tests and start.py
This changes moves from using SQLite in the integration tests and in the
test/boulder-config.json.

It does not port the unit tests over, unfortunately. That's a much more
invasive change.

This also updates the Dockerfile to include the MariaDB and RabbitMQ
requirements of start.py as well as adjusts the CMD to expose the
boulder server to the host machine. The Dockerfile also needed to have
its Go version bumped and the test.sh had to grow some explict
"function"s.

Updates #132
2015-08-07 23:22:52 -07:00
Jeff Hodges 390464ddf4 correct unique indexing of Registrations
Fixes #579 (which blocks #132).

This changes the SA to use a unique index on the sha256 of a
Registration's JWK's public key data instead of on the full serialized
JSON of the JWK. This corrects multiple problems:

 1. MySQL/Mariadb no longer complain about key's being larger than the
 largest allowed key size in an index
 2. We no longer have to worry about large keys not being seen as unique
 3. We no longer have to worry about the JWK's JSON being serialized with its inner keys in different orders and causing incorrectly empty queries or non-unique writes.

This change also hides the details of how Registrations are stored in
the database from the other services outside of SA. This will give us
greater flexibility if we need to move them to another database, or
change their schema, etc.

Also, adds some tests for NoSuchRegistration in the SA.
2015-08-06 14:19:19 -07:00
Roland Shoemaker 461725bc48 Merge pull request #588 from letsencrypt/exp_mailer_db
use GetRegistration RPC outside of SA
2015-08-06 14:07:31 -07:00
Jeff Hodges 1c08a27748 use GetRegistration RPC outside of SA
We move the admin-revoker and expiration-mailer to using the
SA.GetRegistration RPC method instead of digging into the database
itself.

This allows the hiding of the registration model layer inside of SA, so
we can do fancy things with sha256 for the unique index inside of
it. This will happen in a later commit. See #579.

By exposing fewer details about how Registration is stored, we gain more
flexibility to fix up how its stored.

In the expiration-mailer, the performance hit for the early filtering of
mailto is likely neglibible and possibly even a benefit given the cost
of joins to the memory of MySQL.

If need be, we can built a bulk RPC layer for SA that provides the data
we need in findExpiringCertificates. It'll be easier than trying to
scale and change the storage layer underneath for each consumer.
2015-08-06 02:10:54 -07:00
Jeff Hodges 0f03494d56 use pointer to AcmeURL everywhere
This has the benefit of not requiring us to copy very fat url.URL
objects when we pass them to funcs or call their methods.
2015-08-05 18:23:38 -07:00
Jeff Hodges c32790a28c remove unused bucket field from SQLStorageAuthority 2015-07-31 14:05:32 -07:00
Richard Barnes 540de44c81 Fix test failure introduced in merge 2015-07-30 13:56:11 -04:00
Richard Barnes 652702bd7f Merge master 2015-07-30 13:47:10 -04:00
bifurcation 60e82f6df3 Merge pull request #544 from letsencrypt/mysql-uri
Make sure MySQL DB URI contains 'parseTime=true'
2015-07-29 16:53:32 -04:00
Roland Shoemaker 272fbbd480 Merge pull request #541 from r0ro/remove-authz-newcert
Remove the need for a client to send authorizations url when requesting new certificate
2015-07-29 13:10:46 -07:00
Roland Shoemaker df179a1dde Review fixes 2015-07-29 12:17:04 -07:00
Richard Barnes 9e87cef807 Further test fixes 2015-07-29 12:20:00 -04:00
Roland Shoemaker 3a5f96c9e1 Remove debug statement 2015-07-28 10:33:26 -07:00
Romain Fliedel 36cba96fb2 update tests after jwk encoding fix. 2015-07-28 16:25:30 +02:00
Romain Fliedel c5d1189ae8 Add tests for GetLatestValidAuthorization. 2015-07-28 11:45:08 +02:00
Romain Fliedel 236a90afda fix sql request to get only valid authorizations. 2015-07-28 11:45:08 +02:00
Roland Shoemaker ae06aeee30 Move parseTime check to NewDbMap so binaries that don't use a SSA still get the checking 2015-07-27 20:03:20 -07:00
Roland Shoemaker 33a79c3910 Pull out previous parseTime check 2015-07-27 17:57:14 -07:00
Roland Shoemaker 33b59530c6 typo 2015-07-27 17:46:00 -07:00
Roland Shoemaker faed5cc241 Merge branch 'master' into mysql-uri 2015-07-27 17:40:15 -07:00
Roland Shoemaker 9b715a6e9e If using MySQL check for parseTime=true in DSN, if not there add it 2015-07-27 17:39:31 -07:00
Jacob Hoffman-Andrews 4e1051bfdc Fix OCSP updating.
Fixes https://github.com/letsencrypt/boulder/issues/539.

Passes a pointer to tx.Update() in the SA, resolving the gorp error we were
previously receiving in UpdateOCSP.

Fixes CA code to properly receive the error from UpdateOCSP, so future errors
will be logged correctly.
2015-07-27 16:40:04 -07:00
Romain Fliedel 4bbd0fdccd Remove the need for a client to submit authorization urls when requesting a certificate. 2015-07-27 20:26:56 +02:00
Jacob Hoffman-Andrews 9423467142 Switch to our own fork of go-jose.
This is the result of `godep save -r ./...` and
`git rm -r -f Godeps/_workspace/src/github.com/square`

Our fork is currently at the head of go-jose when Richard made the local nonce
changes, with the nonce changes added on top. In other words, the newly created
files are exactly equal to the deleted files.

In a separate commit I will bring our own go-jose fork up to the remote head,
then update our deps.

Also note: Square's go-jose repo contains a `cipher` package. Since we don't
make any changes to that package, we leave it imported as-is.
2015-07-24 14:39:00 -07:00
Jacob Hoffman-Andrews 620a012c62 Rewrite go-jose dependencies to our fork. 2015-07-24 14:16:01 -07:00
Tom Clegg 2d0be62966 Use mock syslog in test suites (except core and log). Drop SwitchLog(). 2015-07-21 17:06:39 -04:00
Jeff Hodges 79d9b52ad0 rename dbName to dbConnect
The configuration is actually a connection string, not a database name,
and it was a bit confusing.
2015-07-10 16:17:27 -07:00
Richard Barnes 9bd9ed08da Change from adding the parameter to enforcing it 2015-06-23 23:18:45 -07:00
Richard Barnes e7a48127e6 Append ?parseTime=true when needed 2015-06-23 23:01:18 -07:00
Roland Shoemaker 403af37a39 Hide Authorization.Expires field when uninitialized 2015-06-17 18:34:30 -07:00
J.C. Jones 41f5788c77 Correct most `go lint` warnings. (274 -> 5) 2015-06-16 22:18:28 -05:00
Jacob Hoffman-Andrews 80d5e50e42 Enable revocation by account key.
In addition to cert private key. This required modifying the GetCertificate*
functions to return core.Certificate instead of certificate bytes.
2015-06-15 12:33:50 -07:00
Roland Shoemaker 2d2efa5e85 Merge pull request #356 from letsencrypt/remove-slash
Revoke path should not end in slash
2015-06-12 13:55:10 -07:00
Jacob Hoffman-Andrews 2b2f4110d4 Revoke path should not end in slash. 2015-06-12 13:26:43 -07:00
Roland Shoemaker f4ee29d1d3 Change all references from SimpleHTTPS -> SimpleHTTP 2015-06-12 11:22:04 -07:00
Jacob Hoffman-Andrews 32531c7f24 Merge pull request #350 from letsencrypt/252-remove_null_key_hack
Issue #252: Remove the hack from Type Converter
2015-06-11 16:22:51 -07:00
J.C. Jones ef0e7fd3f6 New tests
- Write a database.go test
 - Start writing a type-converter.go test
2015-06-11 17:29:38 -05:00
J.C. Jones b0cb08e49a Issue #252: Remove the hack from Type Converter 2015-06-11 13:24:10 -05:00
J.C. Jones 34bad37ab0 Remove dead code `DumpTables`.
If you really want to do this, use
the tools provided with your chosen Database backend.
2015-06-11 13:24:10 -05:00
J.C. Jones 2ad15a4a85 Issue #309: Produce OCSP Responses immediately upon issuance, if at all possible.
This approach performs a best-effort generation of the first OCSP response during
certificate issuance. In the event that OCSP generation fails, it logs a warning at
the Boulder-CA console, but returns successfully since the Certificate was itself
issued.
2015-06-11 11:31:04 -05:00