mirror of
https://github.com/davidallendj/opaal.git
synced 2025-12-20 03:27:02 -07:00
Made it possible to override certain example IDP endpoints
This commit is contained in:
parent
f10a771db6
commit
73e4e50d44
4 changed files with 57 additions and 18 deletions
|
|
@ -164,3 +164,25 @@ func (p *IdentityProvider) FetchJwks() error {
|
|||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *IdentityProvider) UpdateEndpoints(other *IdentityProvider) {
|
||||
UpdateEndpoints(&p.Endpoints, &other.Endpoints)
|
||||
}
|
||||
|
||||
func UpdateEndpoints(eps *Endpoints, other *Endpoints) {
|
||||
// only update endpoints that are not empty
|
||||
var UpdateIf = func(ep *string, s string) {
|
||||
if ep != nil {
|
||||
if *ep != "" {
|
||||
*ep = s
|
||||
}
|
||||
}
|
||||
}
|
||||
UpdateIf(&eps.Config, other.Config)
|
||||
UpdateIf(&eps.Authorization, other.Authorization)
|
||||
UpdateIf(&eps.Token, other.Token)
|
||||
UpdateIf(&eps.Revocation, other.Revocation)
|
||||
UpdateIf(&eps.Introspection, other.Introspection)
|
||||
UpdateIf(&eps.UserInfo, other.UserInfo)
|
||||
UpdateIf(&eps.JwksUri, other.JwksUri)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue