-
Notifications
You must be signed in to change notification settings - Fork 34
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
Added support for cs3 api #72
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
49e84bb
Added support for cs3 api
dynamic-entropy b98bd28
Following corrections were made:
dynamic-entropy 2c46067
Reverted change tof updateCredentials method to static
dynamic-entropy 3faf40c
Use emplace instead of insert to add elements to cmap
dynamic-entropy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#ifndef DAVIX_CS3_UTILS_HPP | ||
#define DAVIX_CS3_UTILS_HPP | ||
|
||
#include <params/davixrequestparams.hpp> | ||
#include <map> | ||
|
||
namespace Davix { | ||
namespace reva { | ||
|
||
struct Credential { | ||
RevaToken token; | ||
bool token_write_access; | ||
}; | ||
|
||
typedef std::map<std::string, Credential> CredentialMap; | ||
|
||
//creates a deep copy of CredentialMap | ||
|
||
/// | ||
/// @class Credentials | ||
/// @brief Reva credentials | ||
/// | ||
/// Reva credentials | ||
class DAVIX_EXPORT Credentials { | ||
public: | ||
Credentials(); | ||
|
||
bool isEmpty() const; | ||
RevaToken getToken(std::string uri) const&; | ||
void getCredentialMap(CredentialMap &cmap) const; | ||
void addCredentials(std::string uri, std::string token, bool token_write_access); | ||
|
||
Credentials(const Credentials&); // Copy constructor | ||
Credentials(Credentials&&); // Move constructor | ||
Credentials& operator=(const Credentials&); // Copy assignment operator | ||
Credentials& operator=(Credentials&&); // Move assignment operator | ||
virtual ~Credentials(); // Destructor | ||
|
||
private: | ||
CredentialMap *credMap; | ||
}; | ||
|
||
|
||
/// | ||
/// @class CredentialProvider | ||
/// @brief Reva credential provider | ||
/// | ||
/// Reva credential provider | ||
class DAVIX_EXPORT CredentialProvider{ | ||
public: | ||
CredentialProvider(){}; | ||
void updateCredentials(Credentials &creds, std::string uri, bool token_write_access); | ||
}; | ||
|
||
|
||
}//Reva | ||
}//Davix | ||
|
||
#endif //DAVIX_CS3_UTILS_HPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Is this an iteration over the whole map?
Wouldn't that mean the
active_token
andpassive_token
values depend only on the last element in the map?Shouldn't there be a filtering by
uri
?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.
This credMap is supposed to live only in the context of that transfer. So we only have two token at any time.
If this is not destroyed when that transfer job completes then we would have to find an alternative.
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 understand. If the map is guaranteed to only have 2 elements in it, it's ok.
Making sure I have to have the correct rationale:
active_token
/passive_token
naming is influenced primarily by 3rd push/pull role (E.g.: destination is active for 3rd pull / source is active for 3rd push)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.
Yes, that is correct. The names are borrowed from a draft RFC on HTTP-TPC.