-
Notifications
You must be signed in to change notification settings - Fork 59
Conversation
@@ -30,5 +30,5 @@ add_library(dsn_runtime STATIC | |||
tracer.cpp | |||
zlocks.cpp | |||
) | |||
target_link_libraries(dsn_runtime dsn_utils) | |||
target_link_libraries(dsn_runtime dsn_utils sasl2 gssapi_krb5 krb5) |
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.
So don't forget to update docs
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.
Which docs do you mean?
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.
_timer->expires_from_now(boost::posix_time::seconds(renew_gap)); | ||
_timer->async_wait([this](const boost::system::error_code &err) { | ||
if (!err.failed()) { | ||
get_credentials(); |
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.
Will you try to find credential in krb5_ccache in other PRs?
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.
It's not internal
https://web.mit.edu/kerberos/krb5-1.12/doc/basic/ccache_def.html
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.
I have read some docs of kerberos. It says
The credential cache file holds Kerberos protocol credentials (for example, tickets, session keys, and other identifying information) in semipermanent storage. The Kerberos protocol reads credentials from the cache as they are required and stores new credentials in the cache as they are obtained. This relieves the application of the responsibility for managing the credentials itself.
in https://www.ibm.com/support/knowledgecenter/en/SSGSMK_7.1.0/management_sym/sym_kerberos_configuring_credential_cache_file.html
And I have read the corresponding code in kudu, there are no code trying to find credentials in krb5_ccache. It only put credentials into krb5_ccache.
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.
so you mean krb5_cc_ funcs are useless? You should read more. It's not for internal. I didn't say we need to use it.
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.
The Kerberos protocol reads credentials from the cache as they are required and stores new credentials in the cache as they are obtained. I didn't say they are useless
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.
So what the credential cache is used for in your opinion? @vagetablechicken
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.
What I said is the basic conceptive problem. krb5_ccache is not for krb internal. The owner can use it to avoid unnecessary connections.
There's no need to optimize prematurely.
Take a look at https://github.com/apache/kudu/blob/master/src/kudu/security/init.cc may help. |
namespace dsn { | ||
namespace security { | ||
// init security(kerberos and sasl) | ||
bool init(bool is_server); |
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.
bool init(bool is_server); | |
extern bool init_server(); | |
extern bool init_client(); |
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.
I think there is no need to split the function into two functions. Because they are almost same
If the config of
enable_auth
is true, we should init kerberos.Here is the detail procedure:
KRB5CCNAME
,KRB5_CONFIG
and so on.New configuration added