From 114f39475fa6f28beb51f1a4265e377aa122fbdb Mon Sep 17 00:00:00 2001 From: Julien Boeuf Date: Thu, 19 Nov 2015 21:45:52 -0800 Subject: Cpp example of how the plugins can be done. --- include/grpc++/security/credentials.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/grpc++/security') diff --git a/include/grpc++/security/credentials.h b/include/grpc++/security/credentials.h index 56827c0f21..acfc3843b3 100644 --- a/include/grpc++/security/credentials.h +++ b/include/grpc++/security/credentials.h @@ -38,6 +38,7 @@ #include #include +#include #include #include #include @@ -207,9 +208,14 @@ class MetadataCredentialsPlugin { // a different thread from the one processing the call. virtual bool IsBlocking() const { return true; } + // Type of credentials this plugin is implementing. + virtual const char* GetType() const { return ""; } + // Gets the auth metatada produced by this plugin. virtual Status GetMetadata( grpc::string_ref service_url, + grpc::string_ref method_name, + const AuthContext& channel_auth_contexst, std::multimap* metadata) = 0; }; -- cgit v1.2.3 From 67c2c957881914aa9b063d1ffb4fb266f5035e09 Mon Sep 17 00:00:00 2001 From: Julien Boeuf Date: Wed, 25 Nov 2015 14:33:19 -0800 Subject: Fixing typo. --- include/grpc++/security/credentials.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/grpc++/security') diff --git a/include/grpc++/security/credentials.h b/include/grpc++/security/credentials.h index acfc3843b3..b21a18656c 100644 --- a/include/grpc++/security/credentials.h +++ b/include/grpc++/security/credentials.h @@ -215,7 +215,7 @@ class MetadataCredentialsPlugin { virtual Status GetMetadata( grpc::string_ref service_url, grpc::string_ref method_name, - const AuthContext& channel_auth_contexst, + const AuthContext& channel_auth_context, std::multimap* metadata) = 0; }; -- cgit v1.2.3 From 6489740a7c7ef9deac0eb00a9d8a9c56e4145cf9 Mon Sep 17 00:00:00 2001 From: Julien Boeuf Date: Wed, 25 Nov 2015 14:42:55 -0800 Subject: Improving documentation. --- include/grpc++/security/credentials.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/grpc++/security') diff --git a/include/grpc++/security/credentials.h b/include/grpc++/security/credentials.h index b21a18656c..ad3572c003 100644 --- a/include/grpc++/security/credentials.h +++ b/include/grpc++/security/credentials.h @@ -212,6 +212,10 @@ class MetadataCredentialsPlugin { virtual const char* GetType() const { return ""; } // Gets the auth metatada produced by this plugin. + // The fully qualified method name is: + // service_url + "/" + method_name. + // The channel_auth_context contains (among other things), the identity of + // the server. virtual Status GetMetadata( grpc::string_ref service_url, grpc::string_ref method_name, -- cgit v1.2.3