diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2023-09-01 16:19:29 +0200 |
|---|---|---|
| committer | Jeroen Wijenbergh <46386452+jwijenbergh@users.noreply.github.com> | 2023-09-01 17:15:52 +0000 |
| commit | 0c14a204ae13f7692a5708451b40f87832f7388a (patch) | |
| tree | 0d9c48397e143adcce2b227c7cf7a6fc48f82adf /internal/server/instituteaccess.go | |
| parent | 1ee57ae13a4d42c44fe6259f2a2d48f0cd20519a (diff) | |
Client + Server: Increase endpoint update frequency and update secure internet handling
Diffstat (limited to 'internal/server/instituteaccess.go')
| -rw-r--r-- | internal/server/instituteaccess.go | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/internal/server/instituteaccess.go b/internal/server/instituteaccess.go index 050e721..a51409f 100644 --- a/internal/server/instituteaccess.go +++ b/internal/server/instituteaccess.go @@ -1,6 +1,7 @@ package server import ( + "github.com/eduvpn/eduvpn-common/internal/discovery" "github.com/eduvpn/eduvpn-common/internal/oauth" "github.com/go-errors/errors" ) @@ -72,6 +73,27 @@ func (ias *InstituteAccessServer) OAuth() *oauth.OAuth { return &ias.Auth } +func (ias *InstituteAccessServer) RefreshEndpoints(_ *discovery.Discovery) error { + // Re-initialize the endpoints + b, err := ias.Base() + if err != nil { + return err + } + + err = b.InitializeEndpoints() + if err != nil { + return err + } + + // update OAuth + auth := ias.OAuth() + if auth != nil { + auth.BaseAuthorizationURL = b.Endpoints.API.V3.Authorization + auth.TokenURL = b.Endpoints.API.V3.Token + } + return nil +} + func (ias *InstituteAccessServer) init( url string, name map[string]string, |
