ucb_ldap 2.0.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -20,45 +20,55 @@ module UCB
20
20
  @entity_name = 'personJobAppointment'
21
21
 
22
22
  def cto_code
23
- berkeleyEduPersonJobApptCTOCode
23
+ warn "DEPRECATED: cto_code is no longer supported"
24
+ []
24
25
  end
25
26
 
26
27
  def deptid
27
- berkeleyEduPersonJobApptDepartment
28
+ warn "DEPRECATED: deptid is no longer supported"
29
+ []
28
30
  end
29
31
 
30
32
  def record_number
31
- berkeleyEduPersonJobApptEmpRecNumber.to_i
33
+ warn "DEPRECATED: record_number is no longer supported"
34
+ []
32
35
  end
33
36
 
34
37
  def personnel_program_code
35
- berkeleyEduPersonJobApptPersPgmCode
38
+ warn "DEPRECATED: personnel_program_code is no longer supported"
39
+ []
36
40
  end
37
41
 
38
42
  def primary?
39
- berkeleyEduPersonJobApptPrimaryFlag
43
+ warn "DEPRECATED: primary? is no longer supported"
44
+ []
40
45
  end
41
46
 
42
47
  # Returns Employee Relation Code
43
48
  def erc_code
44
- berkeleyEduPersonJobApptRelationsCode
49
+ warn "DEPRECATED: erc_code is no longer supported"
50
+ []
45
51
  end
46
52
 
47
53
  def represented?
48
- berkeleyEduPersonJobApptRepresentation != 'U'
54
+ warn "DEPRECATED: represented? is no longer supported"
55
+ []
49
56
  end
50
57
 
51
58
  def title_code
52
- berkeleyEduPersonJobApptTitleCode
59
+ warn "DEPRECATED: title_code is no longer supported"
60
+ []
53
61
  end
54
62
 
55
63
  def appointment_type
56
- berkeleyEduPersonJobApptType
64
+ warn "DEPRECATED: appointment_type is no longer supported"
65
+ []
57
66
  end
58
67
 
59
68
  # Returns +true+ if appointment is Without Salary
60
69
  def wos?
61
- berkeleyEduPersonJobApptWOS
70
+ warn "DEPRECATED: wos? is no longer supported"
71
+ []
62
72
  end
63
73
 
64
74
 
@@ -67,9 +77,8 @@ module UCB
67
77
  # Returns an empty Array ([]) if nothing is found.
68
78
  #
69
79
  def self.find_by_uid(uid)
70
- base = "uid=#{uid},ou=people,dc=berkeley,dc=edu"
71
- filter = Net::LDAP::Filter.eq("objectclass", 'berkeleyEduPersonJobAppt')
72
- search(:base => base, :filter => filter).sort_by { |appt| appt.record_number }
80
+ warn "DEPRECATED: LDAP no longer provides job appointment data. This method will always return an empty array"
81
+ []
73
82
  end
74
83
 
75
84
  end
@@ -26,14 +26,16 @@ module UCB
26
26
  # Returns an +Array+ of Namespace for _uid_.
27
27
  #
28
28
  def self.find_by_uid(uid)
29
- search(:filter => "uid=#{uid}")
29
+ warn "DEPRECATED: Namespaces are no longer supported by LDAP. This method always returns an empty Array"
30
+ []
30
31
  end
31
32
 
32
33
  ##
33
34
  # Returns Namespace instance for _cn_.
34
35
  #
35
36
  def self.find_by_cn(cn)
36
- search(:filter => "cn=#{cn}").first
37
+ warn "DEPRECATED: Namespaces are no longer supported by LDAP. This method always returns an empty Array"
38
+ []
37
39
  end
38
40
  end
39
41
  end
@@ -48,10 +48,6 @@ module UCB::LDAP
48
48
  #
49
49
  # p.org_node #=> Org
50
50
  # p.affiliations #=> Array of Affiliation
51
- # p.addresses #=> Array of Address
52
- # p.job_appointments #=> Array of JobAppointment
53
- # p.namespaces #=> Array of Namespace
54
- # p.student_terms #=> Array of StudentTerm
55
51
  #
56
52
  # ==Attributes
57
53
  #
@@ -124,7 +120,12 @@ module UCB::LDAP
124
120
  alias :dept_code :deptid
125
121
 
126
122
  def dept_name
127
- berkeleyEduUnitCalNetDeptName
123
+ warn "DEPRECATED: LDAP no longer returns department names for person records. You'll need to look up the department code in the org tree. The ucb_orgs gem can help with this"
124
+ deptid
125
+ end
126
+
127
+ def departments
128
+ departmentNumber
128
129
  end
129
130
 
130
131
  ##
@@ -133,7 +134,8 @@ module UCB::LDAP
133
134
  # See UCB::LDAP.authenticate().
134
135
  #
135
136
  def job_appointments
136
- @job_appointments ||= JobAppointment.find_by_uid(uid)
137
+ warn "DEPRECATED: LDAP no longer contains job appointment data - you now need to go through HCM. This method will always return an empty Array"
138
+ []
137
139
  end
138
140
 
139
141
  ##
@@ -52,7 +52,8 @@ module UCB
52
52
  end
53
53
 
54
54
  def employee_expiration_date
55
- Date.parse(berkeleyEduEmpExpDate.to_s)
55
+ warn "DEPRECATED: employee_expiration_date is no longer supported"
56
+ nil
56
57
  end
57
58
 
58
59
  def employee?
@@ -72,7 +73,8 @@ module UCB
72
73
  end
73
74
 
74
75
  def student_expiration_date
75
- Date.parse(berkeleyEduStuExpDate.to_s)
76
+ warn "DEPRECATED: student_expiration_date is no longer supported"
77
+ nil
76
78
  end
77
79
 
78
80
  def student_registered?
@@ -217,7 +219,8 @@ module UCB
217
219
  end
218
220
 
219
221
  def affiliate_expiration_date
220
- Date.parse(berkeleyEduAffExpDate.to_s)
222
+ warn "DEPRECATED: affiliate_expiration_date is no longer supported"
223
+ nil
221
224
  end
222
225
 
223
226
  end
@@ -45,21 +45,24 @@ module UCB
45
45
  # Requires a bind with access to namespaces.
46
46
  # See UCB::LDAP.authenticate().
47
47
  def namespaces
48
- @namespaces ||= Namespace.find_by_uid(uid)
48
+ warn "DEPRECATED: this is no longer supported by LDAP. This method will always return an empty Array"
49
+ []
49
50
  end
50
51
 
51
52
  # Returns +Array+ of Service for this Person.
52
53
  # Requires a bind with access to services.
53
54
  # See UCB::LDAP.authenticate().
54
55
  def services
55
- @services ||= Service.find_by_uid(uid)
56
+ warn "DEPRECATED: this is no longer supported by LDAP. This method will always return an empty Array"
57
+ []
56
58
  end
57
59
 
58
60
  # Returns +Array+ of Address for this Person.
59
61
  # Requires a bind with access to addresses.
60
62
  # See UCB::LDAP.authenticate().
61
63
  def addresses
62
- @addresses ||= Address.find_by_uid(uid)
64
+ warn "DEPRECATED: use postalAddress from a Person entry"
65
+ []
63
66
  end
64
67
 
65
68
  end
@@ -79,10 +79,10 @@ module UCB #:nodoc:
79
79
  end
80
80
 
81
81
  # Load attributes from URL or file
82
- def load_attributes #:nodoc:
82
+ def load_attributes(no_warn=false) #:nodoc:
83
83
  load_attributes_from_url
84
84
  rescue
85
- puts "Warning: schema loading from file"
85
+ puts "Warning: schema loading from file" unless no_warn
86
86
  load_attributes_from_file
87
87
  end
88
88
 
@@ -20,11 +20,11 @@ module UCB
20
20
  # uid_attr.required? #=> true
21
21
  # uid_attr.type #=> 'string'
22
22
  #
23
- # uas_attr = UCB::LDAP::Person.attribute('berkeleyEduUasEligFlag') # case doesn't matter
23
+ # uas_attr = UCB::LDAP::Person.attribute('berkeleyEduNameGenerational') # case doesn't matter
24
24
  #
25
- # uas_attr.name #=> 'berkeleyEduUasEligFlag'
25
+ # uas_attr.name #=> 'berkeleyEduNameGenerational'
26
26
  # uas_attr.aliases #=> ['ucbvalidflag']
27
- # uas_attr.description #=> 'UAS Eligibility Flag'
27
+ # uas_attr.description #=> 'Generational Name'
28
28
  # uas_attr.multi_valued? #=> false
29
29
  # uas_attr.required? #=> false
30
30
  # uas_attr.type #=> 'boolean'
@@ -99,9 +99,8 @@ module UCB
99
99
  # Returns an empty Array ([]) if nothing is found.
100
100
  #
101
101
  def self.find_by_uid(uid)
102
- base = "uid=#{uid},ou=people,dc=berkeley,dc=edu"
103
- filter = Net::LDAP::Filter.eq("objectclass", 'berkeleyEduPersonService')
104
- search(:base => base, :filter => filter)
102
+ warn "DEPRECATED: Services are longer supported by LDAP. This method always returns an empty Array"
103
+ []
105
104
  end
106
105
 
107
106
  end
@@ -20,67 +20,83 @@ module UCB
20
20
  @entity_name = 'personStudentTerm'
21
21
 
22
22
  def change_datetime
23
- UCB::LDAP.local_datetime_parse(berkeleyEduStuChangeDate)
23
+ warn "DEPRECATED: change_datetime is no longer supported"
24
+ []
24
25
  end
25
26
 
26
27
  def college_code
27
- berkeleyEduStuCollegeCode
28
+ warn "DEPRECATED: college_code is no longer supported"
29
+ []
28
30
  end
29
31
 
30
32
  def college_name
31
- berkeleyEduStuCollegeName
33
+ warn "DEPRECATED: college_name is no longer supported"
34
+ []
32
35
  end
33
36
 
34
37
  def level_code
35
- berkeleyEduStuEduLevelCode
38
+ warn "DEPRECATED: level_code is no longer supported"
39
+ []
36
40
  end
37
41
 
38
42
  def level_name
39
- berkeleyEduStuEduLevelName
43
+ warn "DEPRECATED: level_name is no longer supported"
44
+ []
40
45
  end
41
46
 
42
47
  def role_code
43
- berkeleyEduStuEduRoleCode
48
+ warn "DEPRECATED: role_code is no longer supported"
49
+ []
44
50
  end
45
51
 
46
52
  def role_name
47
- berkeleyEduStuEduRoleName
53
+ warn "DEPRECATED: role_name is no longer supported"
54
+ []
48
55
  end
49
56
 
50
57
  def major_code
51
- berkeleyEduStuMajorCode
58
+ warn "DEPRECATED: major_code is no longer supported"
59
+ []
52
60
  end
53
61
 
54
62
  def major_name
55
- berkeleyEduStuMajorName
63
+ warn "DEPRECATED: major_name is no longer supported"
64
+ []
56
65
  end
57
66
 
58
67
  def registration_status_code
59
- berkeleyEduStuRegStatCode
68
+ warn "DEPRECATED: registration_status_code is no longer supported"
69
+ []
60
70
  end
61
71
 
62
72
  def registration_status_name
63
- berkeleyEduStuRegStatName
73
+ warn "DEPRECATED: registration_status_name is no longer supported"
74
+ []
64
75
  end
65
76
 
66
77
  def term_code
67
- berkeleyEduStuTermCode
78
+ warn "DEPRECATED: term_code is no longer supported"
79
+ []
68
80
  end
69
81
 
70
82
  def term_name
71
- berkeleyEduStuTermName
83
+ warn "DEPRECATED: term_name is no longer supported"
84
+ []
72
85
  end
73
86
 
74
87
  def term_status
75
- berkeleyEduStuTermStatus
88
+ warn "DEPRECATED: term_status is no longer supported"
89
+ []
76
90
  end
77
91
 
78
92
  def term_year
79
- berkeleyEduStuTermYear
93
+ warn "DEPRECATED: term_year is no longer supported"
94
+ []
80
95
  end
81
96
 
82
97
  def under_graduate_code
83
- berkeleyEduStuUGCode
98
+ warn "DEPRECATED: under_graduate_code is no longer supported"
99
+ []
84
100
  end
85
101
 
86
102
  ##
@@ -89,9 +105,8 @@ module UCB
89
105
  # Returns an empty Array ([]) if nothing is found.
90
106
  #
91
107
  def self.find_by_uid(uid)
92
- base = "uid=#{uid},ou=people,dc=berkeley,dc=edu"
93
- filter = Net::LDAP::Filter.eq("objectclass", 'berkeleyEduPersonTerm')
94
- search(:base => base, :filter => filter)
108
+ warn "DEPRECATED: Student Terms are no longer supported by LDAP. This method always returns an empty Array"
109
+ []
95
110
  end
96
111
 
97
112
  end
@@ -1,3 +1,3 @@
1
1
  module UcbLdap
2
- VERSION = "2.0.0"
2
+ VERSION = "3.0.0"
3
3
  end
@@ -5,14 +5,17 @@ require 'ucb_ldap/version'
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "ucb_ldap"
7
7
  spec.version = UcbLdap::VERSION
8
- spec.authors = ["Steven Hansen, Steve Downey"]
9
- spec.email = %w{sahglie@gmail.com}
8
+ spec.authors = ["Steven Hansen, Steve Downey, Darin Wilson"]
9
+ spec.email = %w{adminit@berkeley.edu}
10
10
  spec.description = %q{Convenience classes for interacing with UCB's LDAP directory}
11
11
  spec.summary = %q{Convenience classes for interacing with UCB's LDAP directory}
12
- spec.homepage = "https://github.com/sahglie/ucb-ldap"
12
+ spec.homepage = "https://github.com/ucb-ist-eas/ucb-ldap"
13
13
  spec.license = "MIT"
14
14
 
15
- spec.files = `git ls-files`.split($/)
15
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
16
+ f.match(%r{^(test|spec|features)/}) || f.match(/ucb_rails_cli.*\.gem/)
17
+ end
18
+
16
19
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
17
20
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
21
  spec.require_paths = ["lib"]
@@ -21,5 +24,5 @@ Gem::Specification.new do |spec|
21
24
  spec.add_development_dependency "rake"
22
25
  spec.add_development_dependency "rspec"
23
26
 
24
- spec.add_runtime_dependency "net-ldap", "0.2.2"
27
+ spec.add_runtime_dependency "net-ldap", "0.16.1"
25
28
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ucb_ldap
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
- - Steven Hansen, Steve Downey
7
+ - Steven Hansen, Steve Downey, Darin Wilson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-21 00:00:00.000000000 Z
11
+ date: 2018-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -58,22 +58,24 @@ dependencies:
58
58
  requirements:
59
59
  - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: 0.2.2
61
+ version: 0.16.1
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - '='
67
67
  - !ruby/object:Gem::Version
68
- version: 0.2.2
68
+ version: 0.16.1
69
69
  description: Convenience classes for interacing with UCB's LDAP directory
70
70
  email:
71
- - sahglie@gmail.com
71
+ - adminit@berkeley.edu
72
72
  executables: []
73
73
  extensions: []
74
74
  extra_rdoc_files: []
75
75
  files:
76
76
  - ".gitignore"
77
+ - ".irbrc"
78
+ - ".travis.yml"
77
79
  - CHANGELOG
78
80
  - Gemfile
79
81
  - LICENSE.txt
@@ -96,22 +98,8 @@ files:
96
98
  - lib/ucb_ldap/student_term.rb
97
99
  - lib/ucb_ldap/version.rb
98
100
  - schema/schema.yml
99
- - spec/rails_binds.yml
100
- - spec/spec_helper.rb
101
- - spec/ucb_ldap/address_spec.rb
102
- - spec/ucb_ldap/affiliation_spec.rb
103
- - spec/ucb_ldap/entry_spec.rb
104
- - spec/ucb_ldap/job_appointment_spec.rb
105
- - spec/ucb_ldap/namespace_spec.rb
106
- - spec/ucb_ldap/org_spec.rb
107
- - spec/ucb_ldap/person_spec.rb
108
- - spec/ucb_ldap/schema_attribute_spec.rb
109
- - spec/ucb_ldap/schema_spec.rb
110
- - spec/ucb_ldap/service_spec.rb
111
- - spec/ucb_ldap/student_term_spec.rb
112
- - spec/ucb_ldap_spec.rb
113
101
  - ucb_ldap.gemspec
114
- homepage: https://github.com/sahglie/ucb-ldap
102
+ homepage: https://github.com/ucb-ist-eas/ucb-ldap
115
103
  licenses:
116
104
  - MIT
117
105
  metadata: {}
@@ -135,18 +123,4 @@ rubygems_version: 2.6.8
135
123
  signing_key:
136
124
  specification_version: 4
137
125
  summary: Convenience classes for interacing with UCB's LDAP directory
138
- test_files:
139
- - spec/rails_binds.yml
140
- - spec/spec_helper.rb
141
- - spec/ucb_ldap/address_spec.rb
142
- - spec/ucb_ldap/affiliation_spec.rb
143
- - spec/ucb_ldap/entry_spec.rb
144
- - spec/ucb_ldap/job_appointment_spec.rb
145
- - spec/ucb_ldap/namespace_spec.rb
146
- - spec/ucb_ldap/org_spec.rb
147
- - spec/ucb_ldap/person_spec.rb
148
- - spec/ucb_ldap/schema_attribute_spec.rb
149
- - spec/ucb_ldap/schema_spec.rb
150
- - spec/ucb_ldap/service_spec.rb
151
- - spec/ucb_ldap/student_term_spec.rb
152
- - spec/ucb_ldap_spec.rb
126
+ test_files: []