aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Jan Tattermusch <jtattermusch@users.noreply.github.com>2018-01-16 18:21:23 +0100
committerGravatar GitHub <noreply@github.com>2018-01-16 18:21:23 +0100
commite5b7ddd59c9a8b7a33820197abb45e12e2b65daf (patch)
tree10c0237681a70d3bd67ccc518c10948832f34561
parent69d3e0984da394d1ea06edbe26de76d124c6eaf3 (diff)
parenta2044f83c6956d8519c12ad698891f75c9391e50 (diff)
Merge pull request #13363 from grpc/revert-13346-revert-13322-oauth_failure
Revert "Revert "Switching from UNAUTHENTICATED to UNAVAILABLE for auth metadata failure""
-rw-r--r--src/core/lib/security/transport/client_auth_filter.cc2
-rw-r--r--src/csharp/Grpc.IntegrationTesting/MetadataCredentialsTest.cs2
-rw-r--r--src/php/tests/unit_tests/CallCredentials2Test.php4
-rw-r--r--src/ruby/spec/generic/client_stub_spec.rb4
-rw-r--r--test/cpp/end2end/end2end_test.cc8
5 files changed, 10 insertions, 10 deletions
diff --git a/src/core/lib/security/transport/client_auth_filter.cc b/src/core/lib/security/transport/client_auth_filter.cc
index 6a3641f112..6d7f89873b 100644
--- a/src/core/lib/security/transport/client_auth_filter.cc
+++ b/src/core/lib/security/transport/client_auth_filter.cc
@@ -114,7 +114,7 @@ static void on_credentials_metadata(void* arg, grpc_error* input_error) {
grpc_call_next_op(elem, batch);
} else {
error = grpc_error_set_int(error, GRPC_ERROR_INT_GRPC_STATUS,
- GRPC_STATUS_UNAUTHENTICATED);
+ GRPC_STATUS_UNAVAILABLE);
grpc_transport_stream_op_batch_finish_with_failure(batch, error,
calld->call_combiner);
}
diff --git a/src/csharp/Grpc.IntegrationTesting/MetadataCredentialsTest.cs b/src/csharp/Grpc.IntegrationTesting/MetadataCredentialsTest.cs
index eba6276a1f..c83ccd2612 100644
--- a/src/csharp/Grpc.IntegrationTesting/MetadataCredentialsTest.cs
+++ b/src/csharp/Grpc.IntegrationTesting/MetadataCredentialsTest.cs
@@ -162,7 +162,7 @@ namespace Grpc.IntegrationTesting
client = new TestService.TestServiceClient(channel);
var ex = Assert.Throws<RpcException>(() => client.UnaryCall(new SimpleRequest { }));
- Assert.AreEqual(StatusCode.Unauthenticated, ex.Status.StatusCode);
+ Assert.AreEqual(StatusCode.Unavailable, ex.Status.StatusCode);
}
private class FakeTestService : TestService.TestServiceBase
diff --git a/src/php/tests/unit_tests/CallCredentials2Test.php b/src/php/tests/unit_tests/CallCredentials2Test.php
index 0a587906fa..1c7e0c0ff6 100644
--- a/src/php/tests/unit_tests/CallCredentials2Test.php
+++ b/src/php/tests/unit_tests/CallCredentials2Test.php
@@ -147,7 +147,7 @@ class CallCredentials2Test extends PHPUnit_Framework_TestCase
$this->assertTrue($event->send_metadata);
$this->assertTrue($event->send_close);
- $this->assertTrue($event->status->code == Grpc\STATUS_UNAUTHENTICATED);
+ $this->assertTrue($event->status->code == Grpc\STATUS_UNAVAILABLE);
}
public function invalidReturnCallbackFunc($context)
@@ -179,6 +179,6 @@ class CallCredentials2Test extends PHPUnit_Framework_TestCase
$this->assertTrue($event->send_metadata);
$this->assertTrue($event->send_close);
- $this->assertTrue($event->status->code == Grpc\STATUS_UNAUTHENTICATED);
+ $this->assertTrue($event->status->code == Grpc\STATUS_UNAVAILABLE);
}
}
diff --git a/src/ruby/spec/generic/client_stub_spec.rb b/src/ruby/spec/generic/client_stub_spec.rb
index 79eeca9197..5353b534f4 100644
--- a/src/ruby/spec/generic/client_stub_spec.rb
+++ b/src/ruby/spec/generic/client_stub_spec.rb
@@ -228,7 +228,7 @@ describe 'ClientStub' do
th.join
end
- it 'should receive UNAUTHENTICATED if call credentials plugin fails' do
+ it 'should receive UNAVAILABLE if call credentials plugin fails' do
server_port = create_secure_test_server
th = run_request_response(@sent_msg, @resp, @pass)
@@ -252,7 +252,7 @@ describe 'ClientStub' do
unauth_error_occured = false
begin
get_response(stub, credentials: creds)
- rescue GRPC::Unauthenticated => e
+ rescue GRPC::Unavailable => e
unauth_error_occured = true
expect(e.details.include?(error_message)).to be true
end
diff --git a/test/cpp/end2end/end2end_test.cc b/test/cpp/end2end/end2end_test.cc
index 4c8dfe0f40..a6ea5aada9 100644
--- a/test/cpp/end2end/end2end_test.cc
+++ b/test/cpp/end2end/end2end_test.cc
@@ -1609,7 +1609,7 @@ TEST_P(SecureEnd2endTest, AuthMetadataPluginKeyFailure) {
Status s = stub_->Echo(&context, request, &response);
EXPECT_FALSE(s.ok());
- EXPECT_EQ(s.error_code(), StatusCode::UNAUTHENTICATED);
+ EXPECT_EQ(s.error_code(), StatusCode::UNAVAILABLE);
}
TEST_P(SecureEnd2endTest, AuthMetadataPluginValueFailure) {
@@ -1626,7 +1626,7 @@ TEST_P(SecureEnd2endTest, AuthMetadataPluginValueFailure) {
Status s = stub_->Echo(&context, request, &response);
EXPECT_FALSE(s.ok());
- EXPECT_EQ(s.error_code(), StatusCode::UNAUTHENTICATED);
+ EXPECT_EQ(s.error_code(), StatusCode::UNAVAILABLE);
}
TEST_P(SecureEnd2endTest, NonBlockingAuthMetadataPluginFailure) {
@@ -1644,7 +1644,7 @@ TEST_P(SecureEnd2endTest, NonBlockingAuthMetadataPluginFailure) {
Status s = stub_->Echo(&context, request, &response);
EXPECT_FALSE(s.ok());
- EXPECT_EQ(s.error_code(), StatusCode::UNAUTHENTICATED);
+ EXPECT_EQ(s.error_code(), StatusCode::UNAVAILABLE);
EXPECT_EQ(s.error_message(),
grpc::string("Getting metadata from plugin failed with error: ") +
kTestCredsPluginErrorMsg);
@@ -1705,7 +1705,7 @@ TEST_P(SecureEnd2endTest, BlockingAuthMetadataPluginFailure) {
Status s = stub_->Echo(&context, request, &response);
EXPECT_FALSE(s.ok());
- EXPECT_EQ(s.error_code(), StatusCode::UNAUTHENTICATED);
+ EXPECT_EQ(s.error_code(), StatusCode::UNAVAILABLE);
EXPECT_EQ(s.error_message(),
grpc::string("Getting metadata from plugin failed with error: ") +
kTestCredsPluginErrorMsg);