aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp/common/auth_property_iterator_test.cc
diff options
context:
space:
mode:
authorGravatar Julien Boeuf <jboeuf@google.com>2015-07-07 15:23:30 -0700
committerGravatar Julien Boeuf <jboeuf@google.com>2015-07-16 22:42:02 -0700
commitea456fc2bf09e1b80a3add3b898175605da3bf60 (patch)
treec2add1eccaac408b7ffafee95ee41ba4086ba4a7 /test/cpp/common/auth_property_iterator_test.cc
parentc876923bc2a3d9c6bbc03f275a7fe68333b95600 (diff)
Server auth metadata processor.
- Right now it is a global function: would be better to have this per (secure) port. - Changed the interface of the auth_context slightly to make it more friendly. - Positive tests pass. Still need some work on error case (have a negative case as well). - Fixing cpp auth context tests so that they use the shiny new C API.
Diffstat (limited to 'test/cpp/common/auth_property_iterator_test.cc')
-rw-r--r--test/cpp/common/auth_property_iterator_test.cc15
1 files changed, 8 insertions, 7 deletions
diff --git a/test/cpp/common/auth_property_iterator_test.cc b/test/cpp/common/auth_property_iterator_test.cc
index 3d983fa310..6443e2fd85 100644
--- a/test/cpp/common/auth_property_iterator_test.cc
+++ b/test/cpp/common/auth_property_iterator_test.cc
@@ -31,10 +31,10 @@
*
*/
+#include <grpc/grpc_security.h>
#include <grpc++/auth_context.h>
#include <gtest/gtest.h>
#include "src/cpp/common/secure_auth_context.h"
-#include "src/core/security/security_context.h"
namespace grpc {
namespace {
@@ -50,14 +50,15 @@ class TestAuthPropertyIterator : public AuthPropertyIterator {
class AuthPropertyIteratorTest : public ::testing::Test {
protected:
void SetUp() GRPC_OVERRIDE {
- ctx_ = grpc_auth_context_create(NULL, 3);
- ctx_->properties[0] = grpc_auth_property_init_from_cstring("name", "chapi");
- ctx_->properties[1] = grpc_auth_property_init_from_cstring("name", "chapo");
- ctx_->properties[2] = grpc_auth_property_init_from_cstring("foo", "bar");
- ctx_->peer_identity_property_name = ctx_->properties[0].name;
+ ctx_ = grpc_auth_context_create(NULL);
+ grpc_auth_context_add_cstring_property(ctx_, "name", "chapi");
+ grpc_auth_context_add_cstring_property(ctx_, "name", "chapo");
+ grpc_auth_context_add_cstring_property(ctx_, "foo", "bar");
+ EXPECT_EQ(1,
+ grpc_auth_context_set_peer_identity_property_name(ctx_, "name"));
}
void TearDown() GRPC_OVERRIDE {
- GRPC_AUTH_CONTEXT_UNREF(ctx_, "AuthPropertyIteratorTest");
+ grpc_auth_context_release(ctx_);
}
grpc_auth_context* ctx_;