New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature:added permission configuration support for nacos 1.2 #2367
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #2367 +/- ##
=============================================
- Coverage 51.78% 51.75% -0.04%
+ Complexity 2697 2696 -1
=============================================
Files 517 517
Lines 16772 16788 +16
Branches 2030 2030
=============================================
+ Hits 8685 8688 +3
- Misses 7277 7289 +12
- Partials 810 811 +1
|
@@ -191,6 +194,17 @@ private static Properties getConfigProperties() { | |||
} | |||
properties.setProperty(PRO_NAMESPACE_KEY, namespace); | |||
} | |||
if (StringUtils.isNotBlank(System.getProperty(USER_NAME)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be better to write like this:
String userName = StringUtils.isNotBlank(System.getProperty(USER_NAME))
? System.getProperty(USER_NAME)
: FILE_CONFIG.getConfig(getNacosUserName());
String password = StringUtils.isNotBlank(System.getProperty(PASSWORD))
? System.getProperty(PASSWORD)
: FILE_CONFIG.getConfig(getNacosPassword());
if (StringUtils.isNotBlank(userName) && StringUtils.isNotBlank(password)) {
properties.setProperty(USER_NAME, userName);
properties.setProperty(PASSWORD, password);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be better to write like this:
String userName = StringUtils.isNotBlank(System.getProperty(USER_NAME)) ? System.getProperty(USER_NAME) : FILE_CONFIG.getConfig(getNacosUserName()); String password = StringUtils.isNotBlank(System.getProperty(PASSWORD)) ? System.getProperty(PASSWORD) : FILE_CONFIG.getConfig(getNacosPassword()); if (StringUtils.isNotBlank(userName) && StringUtils.isNotBlank(password)) { properties.setProperty(USER_NAME, userName); properties.setProperty(PASSWORD, password); }
thx,i under reference
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does registry conf also need permission?
@objcoding nacos1.2 auth only configuration centers are supported |
ok, now I know. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@objcoding PTAL
@@ -191,6 +194,17 @@ private static Properties getConfigProperties() { | |||
} | |||
properties.setProperty(PRO_NAMESPACE_KEY, namespace); | |||
} | |||
if (StringUtils.isNotBlank(System.getProperty(USER_NAME)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be better to write like this:
String userName = StringUtils.isNotBlank(System.getProperty(USER_NAME)) ? System.getProperty(USER_NAME) : FILE_CONFIG.getConfig(getNacosUserName()); String password = StringUtils.isNotBlank(System.getProperty(PASSWORD)) ? System.getProperty(PASSWORD) : FILE_CONFIG.getConfig(getNacosPassword()); if (StringUtils.isNotBlank(userName) && StringUtils.isNotBlank(password)) { properties.setProperty(USER_NAME, userName); properties.setProperty(PASSWORD, password); }
thx,i under reference
my fault, registry support |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
LGTM. |
配置了密码账号还是403 什么情况 还有其他配置么seata1.2.0 |
Ⅰ. Describe what this PR did
added permission configuration support for nacos 1.2
Ⅱ. Does this pull request fix one issue?
#2365
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews