Skip to content

Commit

Permalink
#gg-9809: all methods return SecurityContext instead of GridSecurityC…
Browse files Browse the repository at this point in the history
…ontext.
  • Loading branch information
ivasilinets committed Feb 18, 2015
1 parent 0c8c2eb commit c507676
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
Expand Up @@ -161,7 +161,7 @@ private IgniteInternalFuture<GridRestResponse> handleRequest(final GridRestReque
if (log.isDebugEnabled())
log.debug("Received request from client: " + req);

GridSecurityContext subjCtx = null;
SecurityContext subjCtx = null;

try {
subjCtx = authenticate(req);
Expand Down Expand Up @@ -436,7 +436,7 @@ else if (obj instanceof Collection) {
* @return Authentication subject context.
* @throws IgniteCheckedException If authentication failed.
*/
private GridSecurityContext authenticate(GridRestRequest req) throws IgniteCheckedException {
private SecurityContext authenticate(GridRestRequest req) throws IgniteCheckedException {
// Authenticate client if invalid session.
AuthenticationContext authCtx = new AuthenticationContext();

Expand Down Expand Up @@ -466,7 +466,7 @@ else if (req.credentials() instanceof String) {

authCtx.credentials(cred);

GridSecurityContext subjCtx = ctx.security().authenticate(authCtx);
SecurityContext subjCtx = ctx.security().authenticate(authCtx);

if (subjCtx == null) {
if (req.credentials() == null)
Expand All @@ -483,7 +483,7 @@ else if (req.credentials() instanceof String) {
* @param sCtx Security context.
* @throws GridSecurityException If authorization failed.
*/
private void authorize(GridRestRequest req, GridSecurityContext sCtx) throws GridSecurityException {
private void authorize(GridRestRequest req, SecurityContext sCtx) throws GridSecurityException {
GridSecurityPermission perm = null;
String name = null;

Expand Down
Expand Up @@ -37,7 +37,7 @@ public interface GridSecurityProcessor extends GridProcessor {
* @return {@code True} if succeeded, {@code false} otherwise.
* @throws IgniteCheckedException If error occurred.
*/
public GridSecurityContext authenticateNode(ClusterNode node, GridSecurityCredentials cred) throws IgniteCheckedException;
public SecurityContext authenticateNode(ClusterNode node, GridSecurityCredentials cred) throws IgniteCheckedException;

/**
* Gets flag indicating whether all nodes or coordinator only should run the authentication for joining node.
Expand All @@ -53,7 +53,7 @@ public interface GridSecurityProcessor extends GridProcessor {
* @return {@code True} if succeeded, {@code false} otherwise.
* @throws IgniteCheckedException If error occurred.
*/
public GridSecurityContext authenticate(AuthenticationContext ctx) throws IgniteCheckedException;
public SecurityContext authenticate(AuthenticationContext ctx) throws IgniteCheckedException;

/**
* Gets collection of authenticated nodes.
Expand All @@ -80,7 +80,7 @@ public interface GridSecurityProcessor extends GridProcessor {
* @param securityCtx Optional security context.
* @throws GridSecurityException If security check failed.
*/
public void authorize(String name, GridSecurityPermission perm, @Nullable GridSecurityContext securityCtx)
public void authorize(String name, GridSecurityPermission perm, @Nullable SecurityContext securityCtx)
throws GridSecurityException;

/**
Expand Down
Expand Up @@ -69,7 +69,7 @@ public GridOsSecurityProcessor(GridKernalContext ctx) {
};

/** {@inheritDoc} */
@Override public GridSecurityContext authenticateNode(ClusterNode node, GridSecurityCredentials cred)
@Override public SecurityContext authenticateNode(ClusterNode node, GridSecurityCredentials cred)
throws IgniteCheckedException {
GridSecuritySubjectAdapter s = new GridSecuritySubjectAdapter(GridSecuritySubjectType.REMOTE_NODE, node.id());

Expand All @@ -86,7 +86,7 @@ public GridOsSecurityProcessor(GridKernalContext ctx) {
}

/** {@inheritDoc} */
@Override public GridSecurityContext authenticate(AuthenticationContext authCtx) throws IgniteCheckedException {
@Override public SecurityContext authenticate(AuthenticationContext authCtx) throws IgniteCheckedException {
GridSecuritySubjectAdapter s = new GridSecuritySubjectAdapter(authCtx.subjectType(), authCtx.subjectId());

s.permissions(ALLOW_ALL);
Expand All @@ -109,7 +109,7 @@ public GridOsSecurityProcessor(GridKernalContext ctx) {
}

/** {@inheritDoc} */
@Override public void authorize(String name, GridSecurityPermission perm, @Nullable GridSecurityContext securityCtx)
@Override public void authorize(String name, GridSecurityPermission perm, @Nullable SecurityContext securityCtx)
throws GridSecurityException {
// No-op.
}
Expand Down
Expand Up @@ -3512,7 +3512,7 @@ private void processNodeAddedMessage(TcpDiscoveryNodeAddedMessage msg) {
else {
SecurityContext subj = nodeAuth.authenticateNode(node, cred);

GridSecurityContext coordSubj = ignite.configuration().getMarshaller().unmarshal(
SecurityContext coordSubj = ignite.configuration().getMarshaller().unmarshal(
node.<byte[]>attribute(IgniteNodeAttributes.ATTR_SECURITY_SUBJECT), U.gridClassLoader());

if (!permissionsEqual(coordSubj.subject().permissions(), subj.subject().permissions())) {
Expand Down

0 comments on commit c507676

Please sign in to comment.