Skip to content

Commit

Permalink
Small cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
abedra committed Nov 20, 2019
1 parent cffd302 commit 965a4fd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions include/VaultClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -267,12 +267,12 @@ class AppRole : public AuthenticationStrategy {
public:
AppRole(std::string role_id, std::string secret_id);

optional<std::string> authenticate(const VaultClient& vaultClient);
optional<std::string> authenticate(const VaultClient& vaultClient) override;
private:
std::string role_id_;
std::string secret_id_;

std::string getUrl(const VaultClient& vaultClient, std::string path);
static std::string getUrl(const VaultClient& vaultClient, std::string path);
};

class KeyValue {
Expand Down
9 changes: 6 additions & 3 deletions src/AppRole.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
#include <nlohmann/json.hpp>
#include <utility>
#include "VaultClient.h"

AppRole::AppRole(std::string role_id, std::string secret_id) :
role_id_(role_id), secret_id_(secret_id) {}
AppRole::AppRole(std::string role_id, std::string secret_id)
: role_id_(std::move(role_id))
, secret_id_(std::move(secret_id))
{}

std::string AppRole::getUrl(const VaultClient& client, std::string path) {
return client.getUrl("/v1/auth/approle", path);
return client.getUrl("/v1/auth/approle", std::move(path));
}

optional<std::string> AppRole::authenticate(const VaultClient& client) {
Expand Down

0 comments on commit 965a4fd

Please sign in to comment.