mirror of
https://github.com/documize/community.git
synced 2025-08-08 23:15:29 +02:00
auth with cas
This commit is contained in:
parent
8c99977fc9
commit
8c2df6178d
150 changed files with 43682 additions and 24175 deletions
28
vendor/gopkg.in/cas.v2/sanitise.go
generated
vendored
Normal file
28
vendor/gopkg.in/cas.v2/sanitise.go
generated
vendored
Normal file
|
@ -0,0 +1,28 @@
|
|||
package cas
|
||||
|
||||
import (
|
||||
"net/url"
|
||||
)
|
||||
|
||||
var (
|
||||
urlCleanParameters = []string{"gateway", "renew", "service", "ticket"}
|
||||
)
|
||||
|
||||
// sanitisedURL cleans a URL of CAS specific parameters
|
||||
func sanitisedURL(unclean *url.URL) *url.URL {
|
||||
// Shouldn't be any errors parsing an existing *url.URL
|
||||
u, _ := url.Parse(unclean.String())
|
||||
q := u.Query()
|
||||
|
||||
for _, param := range urlCleanParameters {
|
||||
q.Del(param)
|
||||
}
|
||||
|
||||
u.RawQuery = q.Encode()
|
||||
return u
|
||||
}
|
||||
|
||||
// sanitisedURLString cleans a URL and returns its string value
|
||||
func sanitisedURLString(unclean *url.URL) string {
|
||||
return sanitisedURL(unclean).String()
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue