Class: Platforms::Certificate
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Platforms::Certificate
- Defined in:
- app/models/platforms/certificate.rb
Overview
Stores customer-specific certificates for authentication
Instance Method Summary collapse
-
#client_secret_privacy ⇒ String
Show a redacted client_secret for admin purposes.
-
#credentials ⇒ Hash
Credentials formatted for OmniAuth.
Instance Method Details
#client_secret_privacy ⇒ String
Show a redacted client_secret for admin purposes. If the client_secret is too short, redacts entirely. Otherwise shows the last 3 characters.
26 27 28 29 30 |
# File 'app/models/platforms/certificate.rb', line 26 def client_secret_privacy return nil if client_secret.nil? return "*****" if client_secret.length < 10 "*****#{client_secret.last(3)}" end |
#credentials ⇒ Hash
Credentials formatted for OmniAuth
34 35 36 37 38 39 |
# File 'app/models/platforms/certificate.rb', line 34 def credentials { client_id: client_id, client_secret: client_secret } end |