Skip to content

Commit

Permalink
remove anon namespace (ydb-platform#8236)
Browse files Browse the repository at this point in the history
  • Loading branch information
maximyurchuk authored Sep 2, 2024
1 parent 03fe8d3 commit df05bf8
Showing 1 changed file with 22 additions and 26 deletions.
48 changes: 22 additions & 26 deletions ydb/core/grpc_services/base/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -696,38 +696,34 @@ class TRefreshTokenImpl
NYql::TIssueManager IssueManager_;
};

namespace {

inline TMaybe<TString> ToMaybe(const TVector<TStringBuf>& vec) {
if (vec.empty()) {
return {};
}
return TString{vec[0]};
}

inline const TMaybe<TString> ExtractYdbToken(const TVector<TStringBuf>& authHeadValues) {
if (authHeadValues.empty()) {
return {};
}
return TString{authHeadValues[0]};
inline TMaybe<TString> ToMaybe(const TVector<TStringBuf>& vec) {
if (vec.empty()) {
return {};
}
return TString{vec[0]};
}

inline const TMaybe<TString> ExtractDatabaseName(const TVector<TStringBuf>& dbHeaderValues) {
if (dbHeaderValues.empty()) {
return {};
}
return CGIUnescapeRet(dbHeaderValues[0]);
inline const TMaybe<TString> ExtractYdbToken(const TVector<TStringBuf>& authHeadValues) {
if (authHeadValues.empty()) {
return {};
}
return TString{authHeadValues[0]};
}

inline TString MakeAuthError(const TString& in, NYql::TIssueManager& issues) {
TStringStream out;
out << "unauthenticated"
<< (in ? ", " : "") << in
<< (issues.GetIssues() ? ": " : "");
issues.GetIssues().PrintTo(out, true /* one line */);
return out.Str();
inline const TMaybe<TString> ExtractDatabaseName(const TVector<TStringBuf>& dbHeaderValues) {
if (dbHeaderValues.empty()) {
return {};
}
return CGIUnescapeRet(dbHeaderValues[0]);
}

inline TString MakeAuthError(const TString& in, NYql::TIssueManager& issues) {
TStringStream out;
out << "unauthenticated"
<< (in ? ", " : "") << in
<< (issues.GetIssues() ? ": " : "");
issues.GetIssues().PrintTo(out, true /* one line */);
return out.Str();
}

template <ui32 TRpcId, typename TReq, typename TResp, TRateLimiterMode RlMode = TRateLimiterMode::Off>
Expand Down

0 comments on commit df05bf8

Please sign in to comment.