diff options
author | Vladimir Shushlin <vshushlin@gitlab.com> | 2019-06-06 21:55:31 +0300 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2019-06-06 21:55:31 +0300 |
commit | c3338c920d6123174000ea11243cb7dc285cee03 (patch) | |
tree | 018ca45fb1ce2b02f9a513321c05fc7a4440abce /app/controllers | |
parent | 68a1ba6a296f340fcddf58e5fbd26d51d66bd90b (diff) |
Add pages domains acme orders
Extract acme double to helper
Create ACME challanges for pages domains
* Create order & challange through API
* save them to database
* request challenge validation
We're saving order and challenge as one entity,
that wouldn't be correct if we would order certificates for
several domains simultaneously, but we always order certificate
per domain
Add controller for processing acme challenges redirected from pages
Don't save acme challenge url - we don't use it
Validate acme challenge attributes
Encrypt private_key in acme orders
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/acme_challenges_controller.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/app/controllers/acme_challenges_controller.rb b/app/controllers/acme_challenges_controller.rb new file mode 100644 index 00000000000..67a39d8870b --- /dev/null +++ b/app/controllers/acme_challenges_controller.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class AcmeChallengesController < ActionController::Base + def show + if acme_order + render plain: acme_order.challenge_file_content, content_type: 'text/plain' + else + head :not_found + end + end + + private + + def acme_order + @acme_order ||= PagesDomainAcmeOrder.find_by_domain_and_token(params[:domain], params[:token]) + end +end |