fix: tests

This commit is contained in:
Fabiennne 2020-08-06 09:21:25 +02:00
parent 3507057c66
commit 4eb2c4e270
10 changed files with 175 additions and 71 deletions

View file

@ -1,6 +1,9 @@
package op
import "time"
import (
"github.com/caos/oidc/pkg/oidc"
"time"
)
const (
ApplicationTypeWeb ApplicationType = iota
@ -16,16 +19,27 @@ type Client interface {
RedirectURIs() []string
PostLogoutRedirectURIs() []string
ApplicationType() ApplicationType
GetAuthMethod() AuthMethod
AuthMethod() AuthMethod
ResponseTypes() []oidc.ResponseType
LoginURL(string) string
AccessTokenType() AccessTokenType
IDTokenLifetime() time.Duration
DevMode() bool
}
func IsConfidentialType(c Client) bool {
return c.ApplicationType() == ApplicationTypeWeb
}
func ContainsResponseType(types []oidc.ResponseType, responseType oidc.ResponseType) bool {
for _, t := range types {
if t == responseType {
return true
}
}
return false
}
type ApplicationType int
type AuthMethod string