Module: OmniAuth::Auth0::Telemetry

Included in:
Strategies::Auth0
Defined in:
lib/omniauth/auth0/telemetry.rb

Overview

Module to provide necessary telemetry for API requests.

Instance Method Summary collapse

Instance Method Details

#telemetryObject

Return a telemetry hash to be encoded and sent to Auth0.

Returns:

  • hash



10
11
12
13
14
15
16
17
18
19
# File 'lib/omniauth/auth0/telemetry.rb', line 10

def telemetry
  telemetry = {
    name: 'omniauth-auth0',
    version: OmniAuth::Auth0::VERSION,
    env: {
      ruby: RUBY_VERSION
    }
  }
  add_rails_version telemetry
end

#telemetry_encodedObject

JSON-ify and base64 encode the current telemetry.

Returns:

  • string



23
24
25
# File 'lib/omniauth/auth0/telemetry.rb', line 23

def telemetry_encoded
  Base64.urlsafe_encode64(JSON.dump(telemetry))
end