feat: dev mode on client, check client configuration (#41)
* fix: tests * fix: tests * fix: tests
This commit is contained in:
parent
3507057c66
commit
c6e22dff69
10 changed files with 215 additions and 71 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue