Class: Ucert::CitrixSharefileTracker
- Inherits:
-
Object
- Object
- Ucert::CitrixSharefileTracker
- Includes:
- Utils
- Defined in:
- lib/ucert/citrix_sharefile_tracker.rb
Overview
Class to handle Citrix Sharefile user account
Instance Attribute Summary collapse
-
#file_sharefile_user_map ⇒ Object
Class constant variables.
-
#sharefile_2_ad_user ⇒ Object
readonly
Returns the value of attribute sharefile_2_ad_user.
-
#sharefile_user_entitlement ⇒ Object
readonly
Returns the value of attribute sharefile_user_entitlement.
-
#sharefile_user_group_entitlement ⇒ Object
readonly
Returns the value of attribute sharefile_user_group_entitlement.
-
#sharefile_user_group_entitlement_report ⇒ Object
Class constant variables.
-
#sharefile_user_status_report ⇒ Object
Class constant variables.
-
#verbose ⇒ Object
Class constant variables.
Instance Method Summary collapse
-
#db_search_by_dn(dn) ⇒ Object
(also: #search_by_dn)
Search user entitlement record by AD DN.
-
#dn_2_index(dn) ⇒ Object
Retrieve the user index from the @sharefile_user_entitlement data structure.
-
#initialize(params = {}) ⇒ CitrixSharefileTracker
constructor
Instance default variables.
Methods included from Utils
#file_2_list, #is_fqdn?, #is_ip?, #is_url?, #list_2_file, #load_known_user_map_from_file, #nslookup, #search_ad, #update_dn
Constructor Details
#initialize(params = {}) ⇒ CitrixSharefileTracker
Instance default variables
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/ucert/citrix_sharefile_tracker.rb', line 21 def initialize (params ={}) @verbose=params.fetch(:verbose, false) # Citrix Sharefile user entitlement report generation instruction: # http://support.citrixonrow.com/en_US/ShareFile/all_files/SF070008 # Please raise a new 'Application Security Request' in the Mantis ticketing system, in order to obtain # the latest copy @sharefile_user_entitlement_report = File.dirname(__FILE__)+"/../../data/citrix_sharefile/ShareFile_Access_Report.xlsx" # Sharefile to AD user map file @file_sharefile_user_map = File.dirname(__FILE__)+"/../../data/citrix_sharefile/sharefile_user_map.txt" # Load user map from the local cacsh file @sharefile_2_ad_user=load_known_user_map_from_file(@file_sharefile_user_map) # Load the user entitlement instance variable from the user report @sharefile_user_entitlement=parse_sharefile_user_entitlement_report(@sharefile_user_entitlement_report) # Procedure to add DN foreign key to the @sharefile_user_entitlement, by performing the AD search insert_dn # Save the user map to local cache file save! end |
Instance Attribute Details
#file_sharefile_user_map ⇒ Object
Class constant variables
17 18 19 |
# File 'lib/ucert/citrix_sharefile_tracker.rb', line 17 def file_sharefile_user_map @file_sharefile_user_map end |
#sharefile_2_ad_user ⇒ Object (readonly)
Returns the value of attribute sharefile_2_ad_user.
18 19 20 |
# File 'lib/ucert/citrix_sharefile_tracker.rb', line 18 def sharefile_2_ad_user @sharefile_2_ad_user end |
#sharefile_user_entitlement ⇒ Object (readonly)
Returns the value of attribute sharefile_user_entitlement.
18 19 20 |
# File 'lib/ucert/citrix_sharefile_tracker.rb', line 18 def sharefile_user_entitlement @sharefile_user_entitlement end |
#sharefile_user_group_entitlement ⇒ Object (readonly)
Returns the value of attribute sharefile_user_group_entitlement.
18 19 20 |
# File 'lib/ucert/citrix_sharefile_tracker.rb', line 18 def sharefile_user_group_entitlement @sharefile_user_group_entitlement end |
#sharefile_user_group_entitlement_report ⇒ Object
Class constant variables
17 18 19 |
# File 'lib/ucert/citrix_sharefile_tracker.rb', line 17 def sharefile_user_group_entitlement_report @sharefile_user_group_entitlement_report end |
#sharefile_user_status_report ⇒ Object
Class constant variables
17 18 19 |
# File 'lib/ucert/citrix_sharefile_tracker.rb', line 17 def sharefile_user_status_report @sharefile_user_status_report end |
#verbose ⇒ Object
Class constant variables
17 18 19 |
# File 'lib/ucert/citrix_sharefile_tracker.rb', line 17 def verbose @verbose end |
Instance Method Details
#db_search_by_dn(dn) ⇒ Object Also known as: search_by_dn
Search user entitlement record by AD DN
181 182 183 184 185 186 187 188 189 190 191 |
# File 'lib/ucert/citrix_sharefile_tracker.rb', line 181 def db_search_by_dn (dn) begin puts "Perform search on the user entitlement records by AD DN: #{dn}" if @verbose @sharefile_user_entitlement.each do |key, val| return val if @sharefile_user_entitlement[key]['DN'].eql? dn end return nil rescue => ee puts "Exception on method #{__method__}: #{ee}" end end |
#dn_2_index(dn) ⇒ Object
Retrieve the user index from the @sharefile_user_entitlement data structure
93 94 95 96 97 98 99 100 101 |
# File 'lib/ucert/citrix_sharefile_tracker.rb', line 93 def dn_2_index (dn) begin (1..@sharefile_user_entitlement.count).map do |index| return index if @sharefile_user_entitlement[index]["DN"]==dn end rescue => ee puts "Exception on method #{__method__}: #{ee}" end end |