summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2014-05-26 09:31:36 +0200
committerAzul <azul@leap.se>2014-05-26 09:31:36 +0200
commit00d5adc90ccadc7f4a2a0d54a5a31a1ad02f05be (patch)
tree2e9655ed7597c3a9d7c520d04f5991d62e7b345b /app
parent3a84578cf33685800c9216cfb4da12ea1fb0032f (diff)
change from GET to POST for certs
We create them. let's reflect that in the verb.
Diffstat (limited to 'app')
-rw-r--r--app/controllers/v1/certs_controller.rb8
-rw-r--r--app/controllers/v1/smtp_certs_controller.rb4
2 files changed, 10 insertions, 2 deletions
diff --git a/app/controllers/v1/certs_controller.rb b/app/controllers/v1/certs_controller.rb
index 73409ef..b6d1d0b 100644
--- a/app/controllers/v1/certs_controller.rb
+++ b/app/controllers/v1/certs_controller.rb
@@ -3,7 +3,15 @@ class V1::CertsController < ApplicationController
before_filter :require_login, :unless => :anonymous_certs_allowed?
# GET /cert
+ # deprecated - we actually create a new cert and that can
+ # be reflected in the action. GET /cert will eventually go
+ # away and be replaced by POST /cert
def show
+ create
+ end
+
+ # POST /cert
+ def create
@cert = ClientCertificate.new(:prefix => service_level.cert_prefix)
render text: @cert.to_s, content_type: 'text/plain'
end
diff --git a/app/controllers/v1/smtp_certs_controller.rb b/app/controllers/v1/smtp_certs_controller.rb
index fcc00b8..377a49c 100644
--- a/app/controllers/v1/smtp_certs_controller.rb
+++ b/app/controllers/v1/smtp_certs_controller.rb
@@ -4,8 +4,8 @@ class V1::SmtpCertsController < ApplicationController
before_filter :require_email_account
before_filter :fetch_identity
- # GET /1/smtp_cert
- def show
+ # POST /1/smtp_cert
+ def create
@cert = ClientCertificate.new prefix: current_user.email_address
@identity.register_cert(@cert)
@identity.save