Class: Nanite::SecurityProvider

Inherits:
Object
  • Object
show all
Defined in:
lib/nanite/security_provider.rb

Overview

This class is used to interface the nanite mapper with an external security module. There are two points of integration:

1. When an agent registers with a mapper
2. When an agent sends a request to another agent

In both these cases the security module is called back and can deny the operation. Note: it’s the responsability of the module to do any logging or notification that is required.

Class Method Summary collapse

Class Method Details

.default_security_moduleObject

Default security module, authorizes all operations



27
28
29
# File 'lib/nanite/security_provider.rb', line 27

def self.default_security_module
  @default_sec_mod ||= DefaultSecurityModule.new
end

.getObject

Used internally by nanite to retrieve the current security module



22
23
24
# File 'lib/nanite/security_provider.rb', line 22

def self.get
  @security_module || default_security_module
end

.register(mod) ⇒ Object

Register an external security module This module should expose the ‘authorize_registration’ and ‘authorize_request’ methods.



17
18
19
# File 'lib/nanite/security_provider.rb', line 17

def self.register(mod)
  @security_module = mod
end