MCPcopy Create free account
hub / github.com/ceph/ceph / AuthMethodList

Method AuthMethodList

src/auth/AuthMethodList.cc:26–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24
25
26AuthMethodList::AuthMethodList(CephContext *cct, std::string str)
27{
28 std::list<std::string> sup_list;
29 get_str_list(str, sup_list);
30 if (sup_list.empty()) {
31 lderr(cct) << "WARNING: empty auth protocol list" << dendl;
32 }
33 for (auto iter = sup_list.begin(); iter != sup_list.end(); ++iter) {
34 ldout(cct, 5) << "adding auth protocol: " << *iter << dendl;
35 if (iter->compare("cephx") == 0) {
36 auth_supported.push_back(CEPH_AUTH_CEPHX);
37 } else if (iter->compare("none") == 0) {
38 auth_supported.push_back(CEPH_AUTH_NONE);
39 } else if (iter->compare("gss") == 0) {
40 auth_supported.push_back(CEPH_AUTH_GSS);
41 } else {
42 auth_supported.push_back(CEPH_AUTH_UNKNOWN);
43 lderr(cct) << "WARNING: unknown auth protocol defined: " << *iter << dendl;
44 }
45 }
46 if (auth_supported.empty()) {
47 lderr(cct) << "WARNING: no auth protocol defined, use 'cephx' by default" << dendl;
48 auth_supported.push_back(CEPH_AUTH_CEPHX);
49 }
50}
51
52bool AuthMethodList::is_supported_auth(int auth_type)
53{

Callers

nothing calls this directly

Calls 6

get_str_listFunction · 0.50
emptyMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
compareMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected