Skip to content

Conversation

coolhongluo
Copy link
Contributor

As a developer, I need to have authentication in service provider to protect the microservice from unauthorized access

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.6%) to 86.433% when pulling eacffc4 on coolhongluo:serviceauth_rsatoken into 58eb0c0 on ServiceComb:master.

@@ -0,0 +1,33 @@
package io.servicecomb.foundation.common.utils;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code template is not correct, please check etc folder for eclipse and IDEA code template

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

accept , forget to format

public static RSAKeyPairEntry getRSAKeyPair() {
try {
KeyPairGenerator keyGenerator = KeyPairGenerator.getInstance(RSA_ALG);
keyGenerator.initialize(1024, new SecureRandom());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

key size is too short

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

accept ,change to 2048

import org.apache.log4j.spi.LoggingEvent;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runners.Parameterized.Parameters;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unused imports, please clear all compile warnings.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

accept

if(!token.isPresent())
{
asyncResp.consumerFail(
new Error("rejected by consumer authentication handler"));
Copy link
Contributor

@liubao68 liubao68 Nov 25, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not throw Error for application invoke. Do you mean this will throw an Error?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

throw new Exception?

jeho0815 added 2 commits November 25, 2017 18:39
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.9%) to 86.181% when pulling 8743f70 on coolhongluo:serviceauth_rsatoken into 58eb0c0 on ServiceComb:master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants