summaryrefslogtreecommitdiff
path: root/internal/server/institute.go
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2024-02-12 19:18:05 +0100
committerJeroen Wijenbergh <46386452+jwijenbergh@users.noreply.github.com>2024-02-19 14:15:07 +0100
commit74e36f0ead717105f26087c2cab08b41ba5a7ce8 (patch)
tree1eb2b7516bea705c9b5a50ce0965e170414ed880 /internal/server/institute.go
parent682d70091af2044ff6d8b350da9dff13163232e2 (diff)
All: Document everything to pass revive lint
Diffstat (limited to 'internal/server/institute.go')
-rw-r--r--internal/server/institute.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/internal/server/institute.go b/internal/server/institute.go
index 881f96d..aa032c7 100644
--- a/internal/server/institute.go
+++ b/internal/server/institute.go
@@ -11,6 +11,11 @@ import (
"github.com/jwijenbergh/eduoauth-go"
)
+// AddInstitute adds an institute access server
+// `ctx` is the context used for cancellation
+// `disco` are the discovery servers
+// `id` is the identifier for the server, the base url
+// `na` is true when authorization should not be triggered
func (s *Servers) AddInstitute(ctx context.Context, disco *discovery.Discovery, id string, na bool) (*Server, error) {
// This is basically done to double check if the server is part of the institute access section of disco
dsrv, err := disco.ServerByURL(id, "institute_access")
@@ -43,6 +48,12 @@ func (s *Servers) AddInstitute(ctx context.Context, disco *discovery.Discovery,
return &inst, nil
}
+// GetInstitute gets an institute access server
+// `ctx` is the context used for cancellation
+// `id` is the identifier for the server, the base url
+// `disco` are the discovery servers
+// `tok` are the tokens such that we do not have to trigger auth
+// `disableAuth` is true when auth should never be triggered
func (s *Servers) GetInstitute(ctx context.Context, id string, disco *discovery.Discovery, tok *eduoauth.Token, disableAuth bool) (*Server, error) {
// This is basically done to double check if the server is part of the institute access section of disco
dsrv, err := disco.ServerByURL(id, "institute_access")