add no-op authenticator

pull/2034/head
v2ray 2016-08-06 23:15:06 +02:00
parent c7d6302292
commit 8d6a9167b5
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
1 changed files with 22 additions and 0 deletions

View File

@ -85,3 +85,25 @@ func (this *AuthenticatorChain) Seal(payload *alloc.Buffer) {
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{} })
}