Module: MnoEnterprise

Defined in:
app/models/mno_enterprise/app.rb,
lib/mno_enterprise/core.rb,
lib/mno_enterprise/engine.rb,
lib/mno_enterprise/version.rb,
lib/mno_enterprise/concerns.rb,
app/models/mno_enterprise/team.rb,
app/models/mno_enterprise/user.rb,
app/models/mno_enterprise/tenant.rb,
app/models/mno_enterprise/ability.rb,
app/models/mno_enterprise/invoice.rb,
app/pdf/mno_enterprise/invoice_pdf.rb,
lib/mno_enterprise/concerns/models.rb,
app/models/mno_enterprise/impac/kpi.rb,
app/models/mno_enterprise/org_invite.rb,
app/models/mno_enterprise/audit_event.rb,
app/models/mno_enterprise/credit_card.rb,
app/models/mno_enterprise/app_instance.rb,
app/models/mno_enterprise/impac/widget.rb,
app/models/mno_enterprise/organization.rb,
app/models/mno_enterprise/base_resource.rb,
lib/mno_enterprise/concerns/controllers.rb,
app/models/mno_enterprise/tenant_invoice.rb,
app/models/mno_enterprise/impac/dashboard.rb,
app/models/mno_enterprise/deletion_request.rb,
app/models/mno_enterprise/arrears_situation.rb,
app/models/mno_enterprise/app_instances_sync.rb,
lib/mno_enterprise/concerns/controllers/auth.rb,
app/helpers/mno_enterprise/application_helper.rb,
app/helpers/mno_enterprise/impersonate_helper.rb,
lib/generators/mno_enterprise/dummy/dummy_generator.rb,
app/controllers/mno_enterprise/application_controller.rb,
app/models/mno_enterprise/impac/dashboard_provisioner.rb,
lib/mno_enterprise/testing_support/user_action_shared.rb,
lib/generators/mno_enterprise/install/install_generator.rb,
lib/generators/mno_enterprise/puma_stack/puma_stack_generator.rb

Overview

Schema Information

Table name: deletion_requests

id             :integer         not null, primary key
token          :string(255)
status         :string(255)
created_at     :datetime        not null
updated_at     :datetime        not null

Defined Under Namespace

Modules: ApplicationHelper, Concerns, DatabaseExtendable, Generators, ImpersonateHelper Classes: Ability, App, AppInstance, AppInstancesSync, ApplicationController, ArrearsSituation, AuditEvent, BaseResource, CreditCard, DatabaseExtensionGenerator, DeletionRequest, DummyGenerator, Engine, Invoice, InvoicePdf, OrgInvite, Organization, Router, Team, Tenant, TenantInvoice, User

Constant Summary collapse

VERSION =
'2.0.3'
@@tenant_name =
'Maestrano Enterprise'
@@app_country =
'US'
@@app_currency =
'USD'
@@tenant_id =
nil
@@tenant_key =
nil
@@impac_api_host =
'https://api-impac-uat.maestrano.io'
@@impac_api_root_path =
"/api/v1"
@@mno_api_host =
"https://api-enterprise.maestrano.com"
@@mno_api_private_host =
nil
@@mno_api_root_path =
"/v1"
@@mnoe_api_v1 =
nil
@@router =
Router.new
@@mandrill_key =
'QcrLVdukhBi7iYrTeWHRPQ'
@@support_email =
"[email protected]"
@@default_sender_name =
nil
@@default_sender_email =
"[email protected]"
@@include_angular_csrf =
false
@@google_tag_container =
nil
@@styleguide =
nil
@@style =
nil
@@marketplace_listing =
nil

Class Method Summary collapse

Class Method Details

.configure {|_self| ... } ⇒ Object

Default way to setup MnoEnterprise. Run rails generate mno-enterprise:install to create a fresh initializer with all configuration values.

Yields:

  • (_self)

Yield Parameters:

  • _self (MnoEnterprise)

    the object that the method was called on



207
208
209
210
211
# File 'lib/mno_enterprise/core.rb', line 207

def self.configure
  yield self
  self.configure_styleguide
  self.configure_api
end

.jwt(payload) ⇒ Object

Create a JSON web token with the provided payload E.g.: MnoEnterprise.jwt({ user_id: ‘usr-427431’ })



215
216
217
218
219
220
221
222
223
224
# File 'lib/mno_enterprise/core.rb', line 215

def self.jwt(payload)
  secret = "#{self.tenant_id}:#{self.tenant_key}"
  iat = Time.now.utc.to_i

  JWT.encode(payload.merge(
    iss: MnoEnterprise.tenant_id,
    iat: iat,
    jit: Digest::MD5.hexdigest("#{secret}:#{iat}")
  ), secret)
end

.styleObject

Always reload style in development



200
201
202
203
# File 'lib/mno_enterprise/core.rb', line 200

def self.style
  self.configure_styleguide if Rails.env.development?
  @@style
end