public static Org.Apache.Hadoop.Oncrpc.Security.Credentials ReadFlavorAndCredentials (XDR xdr) { RpcAuthInfo.AuthFlavor flavor = RpcAuthInfo.AuthFlavor.FromValue(xdr.ReadInt()); Org.Apache.Hadoop.Oncrpc.Security.Credentials credentials; if (flavor == RpcAuthInfo.AuthFlavor.AuthNone) { credentials = new CredentialsNone(); } else { if (flavor == RpcAuthInfo.AuthFlavor.AuthSys) { credentials = new CredentialsSys(); } else { if (flavor == RpcAuthInfo.AuthFlavor.RpcsecGss) { credentials = new CredentialsGSS(); } else { throw new NotSupportedException("Unsupported Credentials Flavor " + flavor); } } } credentials.Read(xdr); return(credentials); }
public virtual void TestReadWrite() { CredentialsSys credential = new CredentialsSys(); credential.SetUID(0); credential.SetGID(1); XDR xdr = new XDR(); credential.Write(xdr); CredentialsSys newCredential = new CredentialsSys(); newCredential.Read(xdr.AsReadOnlyWrap()); Assert.Equal(0, newCredential.GetUID()); Assert.Equal(1, newCredential.GetGID()); }
public SysSecurityHandler(CredentialsSys credentialsSys, IdMappingServiceProvider iug) { this.mCredentialsSys = credentialsSys; this.iug = iug; }