@Override
    public void authenticate(Invocation invocation, URL url) throws RpcAuthenticationException {
        String accessKeyId = String.valueOf(invocation.getAttachment(Constants.AK_KEY));
        String requestTimestamp = String.valueOf(invocation.getAttachment(Constants.REQUEST_TIMESTAMP_KEY));
        String originSignature = String.valueOf(invocation.getAttachment(Constants.REQUEST_SIGNATURE_KEY));
        String consumer = String.valueOf(invocation.getAttachment(CommonConstants.CONSUMER));
        if (StringUtils.isAnyEmpty(accessKeyId, consumer, requestTimestamp, originSignature)) {
            throw new RpcAuthenticationException("Failed to authenticate, maybe consumer side did not enable the auth");
        }

        AccessKeyPair accessKeyPair;
        try {
            accessKeyPair = getAccessKeyPair(invocation, url);
        } catch (Exception e) {
            throw new RpcAuthenticationException("Failed to authenticate , can't load the accessKeyPair", e);
        }

        String computeSignature = getSignature(url, invocation, accessKeyPair.getSecretKey(), requestTimestamp);
        boolean success = computeSignature.equals(originSignature);
        if (!success) {
            throw new RpcAuthenticationException("Failed to authenticate, signature is not correct");
        }
    }
@Test
    void testAuthenticateRequestNoSignature() {
        URL url = URL.valueOf("dubbo://10.10.10.10:2181")
                .addParameter(Constants.ACCESS_KEY_ID_KEY, "ak")
                .addParameter(CommonConstants.APPLICATION_KEY, "test")
                .addParameter(Constants.SECRET_ACCESS_KEY_KEY, "sk");
        Invocation invocation = new RpcInvocation();
        AccessKeyAuthenticator helper = new AccessKeyAuthenticator(ApplicationModel.defaultModel());
        assertThrows(RpcAuthenticationException.class, () -> helper.authenticate(invocation, url));
    }