@@ -29,8 +29,8 @@ import (
29
29
"go.opentelemetry.io/collector/config/confignet"
30
30
"go.opentelemetry.io/collector/config/configopaque"
31
31
"go.opentelemetry.io/collector/config/configtls"
32
- "go.opentelemetry.io/collector/extension/auth "
33
- "go.opentelemetry.io/collector/extension/auth/authtest "
32
+ "go.opentelemetry.io/collector/extension/extensionauth "
33
+ "go.opentelemetry.io/collector/extension/extensionauth/extensionauthtest "
34
34
"go.opentelemetry.io/collector/pdata/ptrace/ptraceotlp"
35
35
)
36
36
@@ -164,7 +164,7 @@ func TestAllGrpcClientSettings(t *testing.T) {
164
164
},
165
165
host : & mockHost {
166
166
ext : map [component.ID ]component.Component {
167
- testAuthID : & authtest .MockClient {},
167
+ testAuthID : & extensionauthtest .MockClient {},
168
168
},
169
169
},
170
170
},
@@ -193,7 +193,7 @@ func TestAllGrpcClientSettings(t *testing.T) {
193
193
},
194
194
host : & mockHost {
195
195
ext : map [component.ID ]component.Component {
196
- testAuthID : & authtest .MockClient {},
196
+ testAuthID : & extensionauthtest .MockClient {},
197
197
},
198
198
},
199
199
},
@@ -222,7 +222,7 @@ func TestAllGrpcClientSettings(t *testing.T) {
222
222
},
223
223
host : & mockHost {
224
224
ext : map [component.ID ]component.Component {
225
- testAuthID : & authtest .MockClient {},
225
+ testAuthID : & extensionauthtest .MockClient {},
226
226
},
227
227
},
228
228
},
@@ -401,7 +401,7 @@ func TestGrpcServerAuthSettings(t *testing.T) {
401
401
}
402
402
host := & mockHost {
403
403
ext : map [component.ID ]component.Component {
404
- mockID : auth .NewServer (),
404
+ mockID : extensionauth .NewServer (),
405
405
},
406
406
}
407
407
srv , err := gss .ToServer (context .Background (), host , componenttest .NewNopTelemetrySettings ())
@@ -976,7 +976,7 @@ func TestDefaultUnaryInterceptorAuthSucceeded(t *testing.T) {
976
976
ctx := metadata .NewIncomingContext (context .Background (), metadata .Pairs ("authorization" , "some-auth-data" ))
977
977
978
978
// test
979
- res , err := authUnaryServerInterceptor (ctx , nil , & grpc.UnaryServerInfo {}, handler , auth .NewServer (auth .WithServerAuthenticate (authFunc )))
979
+ res , err := authUnaryServerInterceptor (ctx , nil , & grpc.UnaryServerInfo {}, handler , extensionauth .NewServer (extensionauth .WithServerAuthenticate (authFunc )))
980
980
981
981
// verify
982
982
assert .Nil (t , res )
@@ -1000,7 +1000,7 @@ func TestDefaultUnaryInterceptorAuthFailure(t *testing.T) {
1000
1000
ctx := metadata .NewIncomingContext (context .Background (), metadata .Pairs ("authorization" , "some-auth-data" ))
1001
1001
1002
1002
// test
1003
- res , err := authUnaryServerInterceptor (ctx , nil , & grpc.UnaryServerInfo {}, handler , auth .NewServer (auth .WithServerAuthenticate (authFunc )))
1003
+ res , err := authUnaryServerInterceptor (ctx , nil , & grpc.UnaryServerInfo {}, handler , extensionauth .NewServer (extensionauth .WithServerAuthenticate (authFunc )))
1004
1004
1005
1005
// verify
1006
1006
assert .Nil (t , res )
@@ -1021,7 +1021,7 @@ func TestDefaultUnaryInterceptorMissingMetadata(t *testing.T) {
1021
1021
}
1022
1022
1023
1023
// test
1024
- res , err := authUnaryServerInterceptor (context .Background (), nil , & grpc.UnaryServerInfo {}, handler , auth .NewServer (auth .WithServerAuthenticate (authFunc )))
1024
+ res , err := authUnaryServerInterceptor (context .Background (), nil , & grpc.UnaryServerInfo {}, handler , extensionauth .NewServer (extensionauth .WithServerAuthenticate (authFunc )))
1025
1025
1026
1026
// verify
1027
1027
assert .Nil (t , res )
@@ -1052,7 +1052,7 @@ func TestDefaultStreamInterceptorAuthSucceeded(t *testing.T) {
1052
1052
}
1053
1053
1054
1054
// test
1055
- err := authStreamServerInterceptor (nil , streamServer , & grpc.StreamServerInfo {}, handler , auth .NewServer (auth .WithServerAuthenticate (authFunc )))
1055
+ err := authStreamServerInterceptor (nil , streamServer , & grpc.StreamServerInfo {}, handler , extensionauth .NewServer (extensionauth .WithServerAuthenticate (authFunc )))
1056
1056
1057
1057
// verify
1058
1058
require .NoError (t , err )
@@ -1078,7 +1078,7 @@ func TestDefaultStreamInterceptorAuthFailure(t *testing.T) {
1078
1078
}
1079
1079
1080
1080
// test
1081
- err := authStreamServerInterceptor (nil , streamServer , & grpc.StreamServerInfo {}, handler , auth .NewServer (auth .WithServerAuthenticate (authFunc )))
1081
+ err := authStreamServerInterceptor (nil , streamServer , & grpc.StreamServerInfo {}, handler , extensionauth .NewServer (extensionauth .WithServerAuthenticate (authFunc )))
1082
1082
1083
1083
// verify
1084
1084
require .ErrorContains (t , err , expectedErr .Error ()) // unfortunately, grpc errors don't wrap the original ones
@@ -1101,7 +1101,7 @@ func TestDefaultStreamInterceptorMissingMetadata(t *testing.T) {
1101
1101
}
1102
1102
1103
1103
// test
1104
- err := authStreamServerInterceptor (nil , streamServer , & grpc.StreamServerInfo {}, handler , auth .NewServer (auth .WithServerAuthenticate (authFunc )))
1104
+ err := authStreamServerInterceptor (nil , streamServer , & grpc.StreamServerInfo {}, handler , extensionauth .NewServer (extensionauth .WithServerAuthenticate (authFunc )))
1105
1105
1106
1106
// verify
1107
1107
assert .Equal (t , errMetadataNotFound , err )
0 commit comments