about summary refs log tree commit diff
path: root/app/lib
diff options
context:
space:
mode:
authorAlex Gessner <alex.gessner@gmail.com>2019-03-28 13:01:09 -0400
committerEugen Rochko <eugen@zeonfederated.com>2019-03-28 18:01:09 +0100
commit69141dca26f8a28d3aff63387b1c8d2bba7fdfa3 (patch)
tree258b59ecbce99855bccb4fd679a5eb3d9938acb0 /app/lib
parent026dd75208223a8ceb8f3e82699a123d68b9a1c7 (diff)
squashed identity proof updates (#10375)
Diffstat (limited to 'app/lib')
-rw-r--r--app/lib/proof_provider/keybase.rb3
-rw-r--r--app/lib/proof_provider/keybase/config_serializer.rb4
-rw-r--r--app/lib/proof_provider/keybase/verifier.rb6
3 files changed, 5 insertions, 8 deletions
diff --git a/app/lib/proof_provider/keybase.rb b/app/lib/proof_provider/keybase.rb
index 96322a265..672e1cb4b 100644
--- a/app/lib/proof_provider/keybase.rb
+++ b/app/lib/proof_provider/keybase.rb
@@ -1,7 +1,8 @@
 # frozen_string_literal: true
 
 class ProofProvider::Keybase
-  BASE_URL = 'https://keybase.io'
+  BASE_URL = ENV.fetch('KEYBASE_BASE_URL', 'https://keybase.io')
+  DOMAIN = ENV.fetch('KEYBASE_DOMAIN', Rails.configuration.x.local_domain)
 
   class Error < StandardError; end
 
diff --git a/app/lib/proof_provider/keybase/config_serializer.rb b/app/lib/proof_provider/keybase/config_serializer.rb
index 557bafe84..5241d201f 100644
--- a/app/lib/proof_provider/keybase/config_serializer.rb
+++ b/app/lib/proof_provider/keybase/config_serializer.rb
@@ -14,7 +14,7 @@ class ProofProvider::Keybase::ConfigSerializer < ActiveModel::Serializer
   end
 
   def domain
-    Rails.configuration.x.local_domain
+    ProofProvider::Keybase::DOMAIN
   end
 
   def display_name
@@ -66,6 +66,6 @@ class ProofProvider::Keybase::ConfigSerializer < ActiveModel::Serializer
   end
 
   def contact
-    [Setting.site_contact_email.presence].compact
+    [Setting.site_contact_email.presence || 'unknown'].compact
   end
 end
diff --git a/app/lib/proof_provider/keybase/verifier.rb b/app/lib/proof_provider/keybase/verifier.rb
index 86f249dd7..ab1422323 100644
--- a/app/lib/proof_provider/keybase/verifier.rb
+++ b/app/lib/proof_provider/keybase/verifier.rb
@@ -49,14 +49,10 @@ class ProofProvider::Keybase::Verifier
 
   def query_params
     {
-      domain: domain,
+      domain: ProofProvider::Keybase::DOMAIN,
       kb_username: @provider_username,
       username: @local_username,
       sig_hash: @token,
     }
   end
-
-  def domain
-    Rails.configuration.x.local_domain
-  end
 end