Consider Reverting removal of JWSVerificationKeySelector#getExpectedJWSAlgorithm

Issue #362 closed
Josh Cummings created an issue

8.18 removes the method JWSVerificationKeySelector#getExpectedJWSAlgorithm to make way for multiple algorithm support: https://bitbucket.org/connect2id/nimbus-jose-jwt/pull-requests/65/accomodate-multiple-algorithms-in/diff#Lsrc/main/java/com/nimbusds/jose/proc/JWSVerificationKeySelector.javaF74

I was surprised that deleting a public method went into a minor release - it, in fact, broke our upgrade to the latest. Was it intentional to remove the method at this time?

One way to move forward while maintaining backward compatibility is re-introducing the method and marking it as deprecated so that it can be removed in a future major release. Its implementation would look something like (psuedocode):

if (singleAlgorithmConstructorWasCalled) {
    return jwsAlg;
} else {
    throw new UnsupportedOperationException("Since there were multiple algorithms specified, " +
        "the behavior of this method is undefined");
}

If removing the method was intentional, then feel free to disregard this issue.

Comments (3)

  1. Log in to comment