mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 11:48:43 -07:00
20 lines
289 B
Go
20 lines
289 B
Go
package auth
|
|
|
|
import (
|
|
"github.com/nats-io/gnatsd/server"
|
|
)
|
|
|
|
type Plain struct {
|
|
Username string
|
|
Password string
|
|
}
|
|
|
|
func (p *Plain) Check(c server.ClientAuth) bool {
|
|
opts := c.GetOpts()
|
|
if p.Username != opts.Username || p.Password != opts.Password {
|
|
return false
|
|
}
|
|
|
|
return true
|
|
}
|