mirror of
https://github.com/pomerium/pomerium.git
synced 2025-06-05 12:23:03 +02:00
remove user impersonation and service account cli (#1768)
* remove user impersonation and service account cli * update doc * remove user impersonation url query params * fix flaky test
This commit is contained in:
parent
eadd8c2482
commit
ab4a68f56f
21 changed files with 258 additions and 831 deletions
|
@ -3,6 +3,8 @@ package grpcutil
|
|||
import (
|
||||
"context"
|
||||
"encoding/base64"
|
||||
"errors"
|
||||
"io"
|
||||
"net"
|
||||
"testing"
|
||||
"time"
|
||||
|
@ -44,21 +46,31 @@ func TestSignedJWT(t *testing.T) {
|
|||
defer cc.Close()
|
||||
|
||||
client := grpc_reflection_v1alpha.NewServerReflectionClient(cc)
|
||||
stream, err := client.ServerReflectionInfo(ctx, grpc.WaitForReady(true))
|
||||
if !assert.NoError(t, err) {
|
||||
return
|
||||
}
|
||||
|
||||
err = stream.Send(&grpc_reflection_v1alpha.ServerReflectionRequest{
|
||||
Host: "",
|
||||
MessageRequest: &grpc_reflection_v1alpha.ServerReflectionRequest_ListServices{},
|
||||
})
|
||||
if !assert.NoError(t, err) {
|
||||
return
|
||||
}
|
||||
for {
|
||||
stream, err := client.ServerReflectionInfo(ctx, grpc.WaitForReady(true))
|
||||
if !assert.NoError(t, err) {
|
||||
return
|
||||
}
|
||||
|
||||
_, err = stream.Recv()
|
||||
assert.Equal(t, codes.Unauthenticated, status.Code(err))
|
||||
err = stream.Send(&grpc_reflection_v1alpha.ServerReflectionRequest{
|
||||
Host: "",
|
||||
MessageRequest: &grpc_reflection_v1alpha.ServerReflectionRequest_ListServices{},
|
||||
})
|
||||
if errors.Is(err, io.EOF) {
|
||||
continue
|
||||
} else if !assert.NoError(t, err) {
|
||||
return
|
||||
}
|
||||
|
||||
_, err = stream.Recv()
|
||||
if errors.Is(err, io.EOF) {
|
||||
continue
|
||||
}
|
||||
assert.Equal(t, codes.Unauthenticated, status.Code(err))
|
||||
|
||||
break
|
||||
}
|
||||
})
|
||||
t.Run("authenticated", func(t *testing.T) {
|
||||
cc, err := grpc.Dial(li.Addr().String(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue