Class: AnalyticsOps::ServiceAccount
- Inherits:
-
Object
- Object
- AnalyticsOps::ServiceAccount
- Defined in:
- lib/analytics_ops/service_account.rb,
sig/analytics_ops.rbs
Overview
The single supported Google authentication source.
Defined Under Namespace
Classes: Store
Constant Summary collapse
- MAX_KEY_BYTES =
64 * 1024
- READ_SCOPE =
"https://www.googleapis.com/auth/analytics.readonly"- EDIT_SCOPE =
"https://www.googleapis.com/auth/analytics.edit"- BIGQUERY_SCOPE =
"https://www.googleapis.com/auth/bigquery.readonly"- ACCESS_SCOPES =
{ read: [READ_SCOPE].freeze, edit: [READ_SCOPE, EDIT_SCOPE].freeze, bigquery: [BIGQUERY_SCOPE].freeze }.freeze
- REQUIRED_FIELDS =
%w[type client_email private_key token_uri].freeze
- CONTROL_CHARACTERS =
/[\u0000-\u001f\u007f]/
Instance Attribute Summary collapse
-
#path ⇒ String
readonly
Returns the value of attribute path.
-
#security_warnings ⇒ Array[String]
readonly
Returns the value of attribute security_warnings.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(path) ⇒ ServiceAccount
constructor
A new instance of ServiceAccount.
Constructor Details
#initialize(path) ⇒ ServiceAccount
Returns a new instance of ServiceAccount.
28 29 30 31 32 33 |
# File 'lib/analytics_ops/service_account.rb', line 28 def initialize(path) @path = validated_path(path).freeze validate_key! @security_warnings = key_security_warnings.map { |warning| warning.dup.freeze }.freeze freeze end |
Instance Attribute Details
#path ⇒ String (readonly)
Returns the value of attribute path.
22 23 24 |
# File 'lib/analytics_ops/service_account.rb', line 22 def path @path end |
#security_warnings ⇒ Array[String] (readonly)
Returns the value of attribute security_warnings.
22 23 24 |
# File 'lib/analytics_ops/service_account.rb', line 22 def security_warnings @security_warnings end |
Class Method Details
.load(path: nil, store: Store.new, connection: nil, config: nil, profile: nil) ⇒ Object
24 25 26 |
# File 'lib/analytics_ops/service_account.rb', line 24 def self.load(path: nil, store: Store.new, connection: nil, config: nil, profile: nil) new(path || store.read(name: connection, config:, profile:)) end |