Commit 3f312f28 authored by Tigran Mkrtchyan's avatar Tigran Mkrtchyan
Browse files

javadoc update

parent 094e200c
......@@ -212,9 +212,16 @@ public class OncRpcSvc {
}
}
/**
* Set {@link GssSessionManager} to handle GSS context if RPCSEG_GSS is used.
* If {@code gssSessionManager} is <i>null</i> GSS authentication will be
* disabled.
* @param gssSessionManager
*/
public void setGssSessionManager( GssSessionManager gssSessionManager) {
_gssSessionManager = gssSessionManager;
}
/**
* Start service.
*/
......
......@@ -23,57 +23,90 @@ package org.dcache.xdr;
*/
public final class RpcAuthStat {
private RpcAuthStat() {}
private RpcAuthStat() {
}
/*
* failed on remote end
*/
/** success */
public static final int AUTH_OK = 0;
/** bad credential (seal broken) */
public static final int AUTH_BADCRED = 1;
/** client must begin new session */
public static final int AUTH_REJECTEDCRED = 2;
/** bad verifier (seal broken) */
public static final int AUTH_BADVERF = 3;
/** verifier expired or replayed */
public static final int AUTH_REJECTEDVERF = 4;
/** rejected for security reasons */
public static final int AUTH_TOOWEAK = 5;
public static final int AUTH_OK = 0; /* success */
public static final int AUTH_BADCRED = 1; /* bad credential (seal broken) */
public static final int AUTH_REJECTEDCRED = 2; /* client must begin new session */
public static final int AUTH_BADVERF = 3; /* bad verifier (seal broken) */
public static final int AUTH_REJECTEDVERF = 4; /* verifier expired or replayed */
public static final int AUTH_TOOWEAK = 5; /* rejected for security reasons */
/*
* failed locally
*/
public static final int AUTH_INVALIDRESP = 6; /* bogus response verifier */
public static final int AUTH_FAILED = 7; /* reason unknown */
/** bogus response verifier */
public static final int AUTH_INVALIDRESP = 6;
/** reason unknown */
public static final int AUTH_FAILED = 7;
/*
* AUTH_KERB errors; deprecated. See [RFC2695]
*/
/** kerberos generic error */
public static final int AUTH_KERB_GENERIC = 8;
/** time of credential expired */
public static final int AUTH_TIMEEXPIRE = 9;
/** problem with ticket file */
public static final int AUTH_TKT_FILE = 10;
/** can't decode authenticator */
public static final int AUTH_DECODE = 11;
/** wrong net address in ticket */
public static final int AUTH_NET_ADDR = 12;
public static final int AUTH_KERB_GENERIC = 8; /* kerberos generic error */
public static final int AUTH_TIMEEXPIRE = 9; /* time of credential expired */
public static final int AUTH_TKT_FILE = 10; /* problem with ticket file */
public static final int AUTH_DECODE = 11; /* can't decode authenticator */
public static final int AUTH_NET_ADDR = 12; /* wrong net address in ticket */
/*
* RPCSEC_GSS GSS related errors
*/
/** no credentials for user */
public static final int RPCSEC_GSS_CREDPROBLEM = 13;
/** problem with context */
public static final int RPCSEC_GSS_CTXPROBLEM = 14;
public static final int RPCSEC_GSS_CREDPROBLEM = 13; /* no credentials for user */
public static final int RPCSEC_GSS_CTXPROBLEM = 14; /* problem with context */
/**
* Get human readable {@link String} representation of error code.
*/
public static String toString(int i) {
switch(i) {
case AUTH_OK: return "OK";
case AUTH_BADCRED: return "AUTH_BADCRED";
case AUTH_REJECTEDCRED: return "AUTH_REJECTEDCRED";
case AUTH_BADVERF: return "AUTH_BADVERF";
case AUTH_REJECTEDVERF: return "AUTH_REJECTEDVERF";
case AUTH_TOOWEAK: return "AUTH_TOOWEAK";
case AUTH_INVALIDRESP: return "AUTH_INVALIDRESP";
case AUTH_FAILED: return "AUTH_FAILED";
case AUTH_KERB_GENERIC: return "AUTH_KERB_GENERIC";
case AUTH_TIMEEXPIRE: return "AUTH_TIMEEXPIRE";
case AUTH_TKT_FILE: return "AUTH_TKT_FILE";
case AUTH_DECODE: return "AUTH_DECODE";
case AUTH_NET_ADDR: return "AUTH_NET_ADDR";
case RPCSEC_GSS_CREDPROBLEM: return "RPCSEC_GSS_CREDPROBLEM";
case RPCSEC_GSS_CTXPROBLEM: return "RPCSEC_GSS_CTXPROBLEM";
switch (i) {
case AUTH_OK:
return "OK";
case AUTH_BADCRED:
return "AUTH_BADCRED";
case AUTH_REJECTEDCRED:
return "AUTH_REJECTEDCRED";
case AUTH_BADVERF:
return "AUTH_BADVERF";
case AUTH_REJECTEDVERF:
return "AUTH_REJECTEDVERF";
case AUTH_TOOWEAK:
return "AUTH_TOOWEAK";
case AUTH_INVALIDRESP:
return "AUTH_INVALIDRESP";
case AUTH_FAILED:
return "AUTH_FAILED";
case AUTH_KERB_GENERIC:
return "AUTH_KERB_GENERIC";
case AUTH_TIMEEXPIRE:
return "AUTH_TIMEEXPIRE";
case AUTH_TKT_FILE:
return "AUTH_TKT_FILE";
case AUTH_DECODE:
return "AUTH_DECODE";
case AUTH_NET_ADDR:
return "AUTH_NET_ADDR";
case RPCSEC_GSS_CREDPROBLEM:
return "RPCSEC_GSS_CREDPROBLEM";
case RPCSEC_GSS_CTXPROBLEM:
return "RPCSEC_GSS_CTXPROBLEM";
}
return "Unknow state " + i;
}
......
......@@ -17,10 +17,25 @@
package org.dcache.xdr;
/**
* RPC message authentication flavor.
* @author tigran
*/
public interface RpcAuthType {
/**
* No authentication.
*/
static public final int NONE = 0;
/**
* UNIX based authentication.
*/
static public final int UNIX = 1;
/**
* GSS API based authentication.
*/
static public final int RPCGSS_SEC = 6;
}
......@@ -104,6 +104,11 @@ public class RpcCall {
_rpcvers = RPCVERS;
}
/**
* Accept message. Have to be called prior processing RPC call.
* @throws IOException
* @throws OncRpcException
*/
public void accept() throws IOException, OncRpcException {
_rpcvers = _xdr.xdrDecodeInt();
if (_rpcvers != RPCVERS) {
......@@ -151,10 +156,17 @@ public class RpcCall {
return _transport;
}
/**
* Get xid associated with this rpc message.
*/
public int getXid() {
return _xid;
}
/**
* Get {@link Xdr} stream used by this message.
* @return xdr stream
*/
public Xdr getXdr() {
return _xdr;
}
......
......@@ -60,6 +60,4 @@ public class XdrBuffer extends Xdr {
_body.flip();
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment