photoprism/internal/server/wellknown/oauth_test.go
Michael Mayer 7a05c5553b OAuth2: Add "POST /api/v1/oauth/revoke" API endpoint #782 #808 #3943
Signed-off-by: Michael Mayer <michael@photoprism.app>
2024-01-10 12:21:43 +01:00

22 lines
701 B
Go

package wellknown
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/photoprism/photoprism/internal/config"
)
func TestOAuthAuthorizationServer(t *testing.T) {
conf := config.TestConfig()
t.Run("New", func(t *testing.T) {
result := NewOAuthAuthorizationServer(conf)
assert.IsType(t, &OAuthAuthorizationServer{}, result)
assert.Equal(t, "http://localhost:2342/api/v1/oauth/token", result.TokenEndpoint)
assert.Equal(t, "http://localhost:2342/api/v1/oauth/revoke", result.RevocationEndpoint)
assert.Equal(t, OAuthResponseTypes, result.ResponseTypesSupported)
assert.Equal(t, OAuthRevocationEndpointAuthMethods, result.RevocationEndpointAuthMethodsSupported)
})
}