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
d4990244
Commit
d4990244
authored
9 years ago
by
Alinga Yeung
Browse files
Options
Downloads
Patches
Plain Diff
Story 1657 rework. Removed debug statements and removed usage of deprecated X500Principal.
parent
49773ae7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
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/web/users/GetUserAction.java
+2
-27
2 additions, 27 deletions
...er/src/ca/nrc/cadc/ac/server/web/users/GetUserAction.java
with
2 additions
and
27 deletions
projects/cadcAccessControl-Server/src/ca/nrc/cadc/ac/server/web/users/GetUserAction.java
+
2
−
27
View file @
d4990244
...
...
@@ -81,10 +81,10 @@ import java.security.PrivilegedExceptionAction;
import
java.util.Set
;
import
javax.security.auth.Subject
;
import
javax.security.auth.x500.X500Principal
;
import
org.apache.log4j.Logger
;
import
com.sun.security.auth.X500Principal
;
public
class
GetUserAction
extends
AbstractUserAction
...
...
@@ -102,12 +102,10 @@ public class GetUserAction extends AbstractUserAction
public
void
doAction
()
throws
Exception
{
log
.
debug
(
"alinga-- GetUserAction.doAction(): enter"
);
User
<
Principal
>
user
;
if
(
isAugmentUser
())
{
log
.
debug
(
"alinga-- GetUserAction.doAction(): is an augment user"
);
Subject
subject
=
new
Subject
();
subject
.
getPrincipals
().
add
(
this
.
userID
);
user
=
Subject
.
doAs
(
subject
,
new
PrivilegedExceptionAction
<
User
<
Principal
>>()
...
...
@@ -122,12 +120,10 @@ public class GetUserAction extends AbstractUserAction
}
else
{
log
.
debug
(
"alinga-- GetUserAction.doAction(): is not an augment user"
);
user
=
getUser
(
this
.
userID
);
}
writeUser
(
user
);
log
.
debug
(
"alinga-- GetUserAction.doAction(): exit"
);
}
protected
User
<
Principal
>
getUser
(
Principal
principal
)
throws
Exception
...
...
@@ -180,29 +176,8 @@ public class GetUserAction extends AbstractUserAction
Subject
subject
=
Subject
.
getSubject
(
acc
);
if
(
subject
!=
null
)
{
log
.
debug
(
"alinga-- GetUserAction.isAugmentUser(): subject is not null."
);
for
(
Principal
principal
:
subject
.
getPrincipals
(
X500Principal
.
class
))
for
(
Principal
principal
:
subject
.
getPrincipals
(
HttpPrincipal
.
class
))
{
log
.
debug
(
"alinga-- GetUserAction.isAugmentUser(): principal = "
+
principal
);
log
.
debug
(
"alinga-- GetUserAction.isAugmentUser(): principal name = "
+
principal
.
getName
());
log
.
debug
(
"alinga-- GetUserAction.isAugmentUser(): augmentUserDN = "
+
this
.
getAugmentUserDN
());
if
(
principal
instanceof
X500Principal
)
{
log
.
debug
(
"alinga-- UserClientTest constructor(): servops is X500Principal."
);
}
else
if
(
principal
instanceof
HttpPrincipal
)
{
log
.
debug
(
"alinga-- UserClientTest constructor(): servops is X500Principal."
);
}
else
if
(
principal
instanceof
NumericPrincipal
)
{
log
.
debug
(
"alinga-- UserClientTest constructor(): servops is X500Principal."
);
}
else
{
log
.
debug
(
"alinga-- UserClientTest constructor(): servops is unknown principal."
);
}
if
(
principal
.
getName
().
equals
(
this
.
getAugmentUserDN
()))
{
return
true
;
...
...
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