1
0
mirror of https://github.com/oauth2-proxy/oauth2-proxy.git synced 2024-11-28 09:08:44 +02:00
oauth2-proxy/htpasswd_test.go

17 lines
329 B
Go
Raw Normal View History

2012-12-17 21:38:33 +03:00
package main
import (
"bytes"
"github.com/stretchr/testify/assert"
2012-12-17 21:38:33 +03:00
"testing"
)
func TestHtpasswd(t *testing.T) {
file := bytes.NewBuffer([]byte("testuser:{SHA}PaVBVZkYqAjCQCu6UBL2xgsnZhw=\n"))
h, err := NewHtpasswd(file)
assert.Equal(t, err, nil)
valid := h.Validate("testuser", "asdf")
assert.Equal(t, valid, true)
}