mirror of https://github.com/v2ray/v2ray-core
add no-op authenticator
parent
c7d6302292
commit
8d6a9167b5
|
@ -85,3 +85,25 @@ func (this *AuthenticatorChain) Seal(payload *alloc.Buffer) {
|
||||||
auth.Seal(payload)
|
auth.Seal(payload)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type NoOpAuthenticator struct{}
|
||||||
|
|
||||||
|
func (this NoOpAuthenticator) Overhead() int {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
func (this NoOpAuthenticator) Open(payload *alloc.Buffer) bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
func (this NoOpAuthenticator) Seal(payload *alloc.Buffer) {}
|
||||||
|
|
||||||
|
type NoOpAuthenticatorFactory struct{}
|
||||||
|
|
||||||
|
func (this NoOpAuthenticatorFactory) Create(config AuthenticatorConfig) Authenticator {
|
||||||
|
return NoOpAuthenticator{}
|
||||||
|
}
|
||||||
|
|
||||||
|
type NoOpAuthenticatorConfig struct{}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
RegisterAuthenticator("none", NoOpAuthenticatorFactory{}, func() interface{} { return NoOpAuthenticatorConfig{} })
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue