Skip to content

Commit 0dd70a0

Browse files
committed
Add unit test assertions to verify the generated token has no padding.
Change-Id: I7b948a13a075d7afeac19f96b9372f23b60d4eda
1 parent 0be74eb commit 0dd70a0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cab-token-generator/javatests/com/google/auth/credentialaccessboundary/ClientSideCredentialAccessBoundaryFactoryTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -745,6 +745,9 @@ public void generateToken_withAvailablityCondition_success() throws Exception {
745745
CabToken cabToken = parseCabToken(token);
746746
assertEquals("accessToken", cabToken.intermediateToken);
747747

748+
// Verifies the encrypted restriction has no padding
749+
assertFalse(cabToken.encryptedRestriction.contains(String.valueOf("=")));
750+
748751
// Checks the encrypted restriction is the correct proto format of the CredentialAccessBoundary.
749752
ClientSideAccessBoundary clientSideAccessBoundary =
750753
decryptRestriction(
@@ -795,6 +798,9 @@ public void generateToken_withoutAvailabilityCondition_success() throws Exceptio
795798
CabToken cabToken = parseCabToken(token);
796799
assertEquals("accessToken", cabToken.intermediateToken);
797800

801+
// Verifies the encrypted restriction has no padding
802+
assertFalse(cabToken.encryptedRestriction.contains(String.valueOf("=")));
803+
798804
// Checks the encrypted restriction is the correct proto format of the CredentialAccessBoundary.
799805
ClientSideAccessBoundary clientSideAccessBoundary =
800806
decryptRestriction(

0 commit comments

Comments
 (0)