use of com.yahoo.athenz.common.server.log.AuditLogMsgBuilder in project athenz by yahoo.
the class ZMSImplTest method testGetAuditLogMsgBuilder.
@Test
public void testGetAuditLogMsgBuilder() {
AuditLogMsgBuilder msgBldr = ZMSUtils.getAuditLogMsgBuilder(mockDomRsrcCtx, auditLogger, "mydomain", auditRef, "myapi", "PUT");
assertNotNull(msgBldr);
}
use of com.yahoo.athenz.common.server.log.AuditLogMsgBuilder in project athenz by yahoo.
the class ZMSImplTest method testGetAuditLogMsgBuilderTokenWithSig.
@Test
public void testGetAuditLogMsgBuilderTokenWithSig() {
Authority principalAuthority = new com.yahoo.athenz.common.server.debug.DebugPrincipalAuthority();
String userId = "user1";
String signature = "ABRACADABRA";
String unsignedCreds = "v=U1;d=user;n=user1";
Principal principal = SimplePrincipal.create("user", userId, unsignedCreds + ";s=" + signature, 0, principalAuthority);
// set unsigned creds
((SimplePrincipal) principal).setUnsignedCreds(unsignedCreds);
ResourceContext ctx = createResourceContext(principal);
AuditLogMsgBuilder msgBldr = ZMSUtils.getAuditLogMsgBuilder(ctx, auditLogger, "mydomain", auditRef, "myapi", "PUT");
assertNotNull(msgBldr);
String who = msgBldr.who();
assertNotNull(who);
assertTrue(who.contains(userId));
assertTrue(!who.contains(signature), "Should not contain the signature: " + who);
}
use of com.yahoo.athenz.common.server.log.AuditLogMsgBuilder in project athenz by yahoo.
the class ZMSImplTest method testGetAuditLogMsgBuilderNullCtx.
@Test
public void testGetAuditLogMsgBuilderNullCtx() {
AuditLogMsgBuilder msgBldr = ZMSUtils.getAuditLogMsgBuilder(null, auditLogger, "mydomain", auditRef, "myapi", "PUT");
assertNotNull(msgBldr);
}
use of com.yahoo.athenz.common.server.log.AuditLogMsgBuilder in project athenz by yahoo.
the class ZMSImplTest method testGetAuditLogMsgBuilderNullParams.
@Test
public void testGetAuditLogMsgBuilderNullParams() {
AuditLogMsgBuilder msgBldr = ZMSUtils.getAuditLogMsgBuilder(mockDomRsrcCtx, auditLogger, null, null, null, null);
assertNotNull(msgBldr);
}
use of com.yahoo.athenz.common.server.log.AuditLogMsgBuilder in project athenz by yahoo.
the class ZMSImplTest method testGetAuditLogMsgBuilderNullPrincipal.
@Test
public void testGetAuditLogMsgBuilderNullPrincipal() {
ResourceContext ctx = createResourceContext(null);
AuditLogMsgBuilder msgBldr = ZMSUtils.getAuditLogMsgBuilder(ctx, auditLogger, "mydomain", auditRef, "myapi", "PUT");
assertNotNull(msgBldr);
}
Aggregations