Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ac
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OATS-CADC
ac
Commits
6fa062bd
Commit
6fa062bd
authored
10 years ago
by
Adrian Damian
Browse files
Options
Downloads
Plain Diff
Merge branch 's1651' of /usr/cadc/dev/git/wopencadc into s1651
parents
3f5a20d7
9d7c2c0b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
projects/cadcAccessControl-Server/src/ca/nrc/cadc/ac/server/ldap/LdapConfig.java
+42
-2
42 additions, 2 deletions
...rol-Server/src/ca/nrc/cadc/ac/server/ldap/LdapConfig.java
with
42 additions
and
2 deletions
projects/cadcAccessControl-Server/src/ca/nrc/cadc/ac/server/ldap/LdapConfig.java
+
42
−
2
View file @
6fa062bd
...
@@ -89,6 +89,9 @@ public class LdapConfig
...
@@ -89,6 +89,9 @@ public class LdapConfig
public
static
final
String
LDAP_USERS_DN
=
"usersDn"
;
public
static
final
String
LDAP_USERS_DN
=
"usersDn"
;
public
static
final
String
LDAP_GROUPS_DN
=
"groupsDn"
;
public
static
final
String
LDAP_GROUPS_DN
=
"groupsDn"
;
public
static
final
String
LDAP_ADMIN_GROUPS_DN
=
"adminGroupsDn"
;
public
static
final
String
LDAP_ADMIN_GROUPS_DN
=
"adminGroupsDn"
;
public
static
final
String
LDAP_AVAIL_TEST_GROUP
=
"availabilityTestGroup"
;
public
static
final
String
LDAP_AVAIL_TEST_CALLING_USER_DN
=
"availabilityTestCallingUserDN"
;
private
String
usersDN
;
private
String
usersDN
;
private
String
groupsDN
;
private
String
groupsDN
;
...
@@ -97,6 +100,9 @@ public class LdapConfig
...
@@ -97,6 +100,9 @@ public class LdapConfig
private
int
port
;
private
int
port
;
private
String
adminUserDN
;
private
String
adminUserDN
;
private
String
adminPasswd
;
private
String
adminPasswd
;
private
String
availabilityTestGroup
;
private
String
availabilityTestCallingUserDN
;
public
static
LdapConfig
getLdapConfig
()
public
static
LdapConfig
getLdapConfig
()
{
{
...
@@ -167,15 +173,36 @@ public class LdapConfig
...
@@ -167,15 +173,36 @@ public class LdapConfig
throw
new
RuntimeException
(
"failed to read property "
+
throw
new
RuntimeException
(
"failed to read property "
+
LDAP_ADMIN_GROUPS_DN
);
LDAP_ADMIN_GROUPS_DN
);
}
}
String
availGroup
=
config
.
getProperty
(
LDAP_AVAIL_TEST_GROUP
);
if
(!
StringUtil
.
hasText
(
availGroup
))
{
throw
new
RuntimeException
(
"failed to read property "
+
LDAP_AVAIL_TEST_GROUP
);
}
String
availUser
=
config
.
getProperty
(
LDAP_AVAIL_TEST_CALLING_USER_DN
);
if
(!
StringUtil
.
hasText
(
availUser
))
{
throw
new
RuntimeException
(
"failed to read property "
+
LDAP_AVAIL_TEST_CALLING_USER_DN
);
}
return
new
LdapConfig
(
server
,
Integer
.
valueOf
(
port
),
ldapAdmin
,
return
new
LdapConfig
(
server
,
Integer
.
valueOf
(
port
),
ldapAdmin
,
ldapPasswd
,
ldapUsersDn
,
ldapGroupsDn
,
ldapPasswd
,
ldapUsersDn
,
ldapGroupsDn
,
ldapAdminGroupsDn
);
ldapAdminGroupsDn
,
availGroup
,
availUser
);
}
public
LdapConfig
(
String
server
,
int
port
,
String
adminUserDN
,
String
adminPasswd
,
String
usersDN
,
String
groupsDN
,
String
adminGroupsDN
)
{
this
(
server
,
port
,
adminUserDN
,
adminPasswd
,
usersDN
,
groupsDN
,
adminGroupsDN
,
null
,
null
);
}
}
public
LdapConfig
(
String
server
,
int
port
,
String
adminUserDN
,
public
LdapConfig
(
String
server
,
int
port
,
String
adminUserDN
,
String
adminPasswd
,
String
usersDN
,
String
groupsDN
,
String
adminPasswd
,
String
usersDN
,
String
groupsDN
,
String
adminGroupsDN
)
String
adminGroupsDN
,
String
availGroup
,
String
availUser
)
{
{
if
(!
StringUtil
.
hasText
(
server
))
if
(!
StringUtil
.
hasText
(
server
))
{
{
...
@@ -206,6 +233,7 @@ public class LdapConfig
...
@@ -206,6 +233,7 @@ public class LdapConfig
{
{
throw
new
IllegalArgumentException
(
"Illegal admin groups LDAP DN"
);
throw
new
IllegalArgumentException
(
"Illegal admin groups LDAP DN"
);
}
}
this
.
server
=
server
;
this
.
server
=
server
;
this
.
port
=
port
;
this
.
port
=
port
;
...
@@ -214,6 +242,8 @@ public class LdapConfig
...
@@ -214,6 +242,8 @@ public class LdapConfig
this
.
usersDN
=
usersDN
;
this
.
usersDN
=
usersDN
;
this
.
groupsDN
=
groupsDN
;
this
.
groupsDN
=
groupsDN
;
this
.
adminGroupsDN
=
adminGroupsDN
;
this
.
adminGroupsDN
=
adminGroupsDN
;
this
.
availabilityTestGroup
=
availGroup
;
this
.
availabilityTestCallingUserDN
=
availUser
;
}
}
public
String
getUsersDN
()
public
String
getUsersDN
()
...
@@ -250,5 +280,15 @@ public class LdapConfig
...
@@ -250,5 +280,15 @@ public class LdapConfig
{
{
return
this
.
adminPasswd
;
return
this
.
adminPasswd
;
}
}
public
String
getAvailabilityTestGroup
()
{
return
this
.
availabilityTestGroup
;
}
public
String
getAvailabilityTestCallingUserDN
()
{
return
this
.
availabilityTestCallingUserDN
;
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment