Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/discourse/discourse-auth-proxy
/ functions
Functions
57 in github.com/discourse/discourse-auth-proxy
⨍
Functions
57
◇
Types & classes
11
↓ 7 callers
Function
NewStringSet
(s string)
string_set.go:9
↓ 5 callers
Function
GetTestResult
(t *testing.T, configOverride ConfigOverrideFunc, ssoOverride SSOOverrideFunc)
main_test.go:89
↓ 5 callers
Function
computeHMAC
computeHMAC implements the Discourse SSO protocol, returning a hex string.
main.go:323
↓ 4 callers
Function
NewTestConfig
()
main_test.go:34
↓ 4 callers
Function
allowedByWhiteList
(c *Config, p string)
main.go:131
↓ 4 callers
Function
mustParseURL
(s string)
main_test.go:26
↓ 4 callers
Function
parseCookie
(data, secret string)
main.go:273
↓ 4 callers
Function
signCookie
(data, secret string)
main.go:269
↓ 3 callers
Method
Printf
(format string, v ...interface{})
logging.go:24
↓ 2 callers
Function
addNonce
addNonce takes a return URL and returns a nonce associated to that URL.
main.go:314
↓ 2 callers
Function
authProxyHandler
(handler http.Handler)
main.go:88
↓ 2 callers
Function
initDirector
(target *url.URL)
internal/httpproxy/backend.go:195
↓ 2 callers
Method
name
name returns the host component from b.target and a boolean indicating whether the host component is likely to be a resolvable name.
internal/httpproxy/backend.go:180
↓ 2 callers
Function
srvToTCPAddr
(srv *net.SRV)
internal/httpproxy/backend.go:206
↓ 1 callers
Function
BuildTestSSOURL
(options SSOOptions)
main_test.go:72
↓ 1 callers
Method
Contains
(needle string)
string_set.go:16
↓ 1 callers
Method
ContainsAny
(needles StringSet)
string_set.go:25
↓ 1 callers
Method
Lookup
Lookup continuously polls the DNS for new target SRV records. One lookup is made shortly upon entry into this function, then every interval thereafte
internal/httpproxy/backend.go:90
↓ 1 callers
Function
NewDNSSRVBackend
NewDNSSRVBackend returns a new DNSSRVBackend value. The host in target will eventually be queried for DNS SRV records. If none are found, or if the
internal/httpproxy/backend.go:55
↓ 1 callers
Function
NewSSOOptions
(url string, secret string)
main_test.go:53
↓ 1 callers
Function
ParseConfig
()
config.go:34
↓ 1 callers
Function
RegisterTestNonce
(t *testing.T, options SSOOptions)
main_test.go:61
↓ 1 callers
Method
Write
(b []byte)
logging.go:41
↓ 1 callers
Function
checkAuthorizationHeader
(handler http.Handler, r *http.Request, w http.ResponseWriter)
main.go:100
↓ 1 callers
Function
checkWhitelist
(handler http.Handler, r *http.Request, w http.ResponseWriter)
main.go:145
↓ 1 callers
Method
findDirector
()
internal/httpproxy/backend.go:143
↓ 1 callers
Function
getReturnUrl
(secret string, payload string, sig string, nonce string)
main.go:248
↓ 1 callers
Method
getSrvs
()
internal/httpproxy/backend.go:161
↓ 1 callers
Function
initDirectorFromSRV
(target *url.URL, srv *net.SRV)
internal/httpproxy/backend.go:200
↓ 1 callers
Function
logHandler
(next http.Handler)
logging.go:56
↓ 1 callers
Method
lookupOne
(ctx context.Context)
internal/httpproxy/backend.go:133
↓ 1 callers
Function
newDirectorIDFromSRV
(srv *net.SRV)
internal/httpproxy/backend.go:19
↓ 1 callers
Function
newRateLimitedLogger
(out io.Writer, prefix string, flag int)
logging.go:17
↓ 1 callers
Function
parseRawConfig
()
config.go:127
↓ 1 callers
Function
randomJitter
(max time.Duration)
internal/httpproxy/backend.go:259
↓ 1 callers
Function
redirectIfNoCookie
(handler http.Handler, r *http.Request, w http.ResponseWriter)
main.go:154
↓ 1 callers
Method
setSrvs
(srvs []*net.SRV)
internal/httpproxy/backend.go:172
↓ 1 callers
Function
srvFilterTopPriority
srvFilterTopPriority returns, from srvs, the set of SRV RRs that share the most-preferred priority, whatever that priority value might be. Relative
internal/httpproxy/backend.go:214
↓ 1 callers
Function
srvShuffleByWeight
srvShuffleByWeight applies the weight shuffling algorithm described in RFC 2782 to a slice of SRV RRs of equivalent priority. This implementation was
internal/httpproxy/backend.go:236
↓ 1 callers
Function
sso_payload
sso_payload takes the SSO secret and the two redirection URLs, stores the returnUrl in the nonce cache, and returns a partial URL querystring.
main.go:303
↓ 1 callers
Function
usage
(err error)
config.go:149
Method
Director
Director implements a httputil.ReverseProxy Director. The host and port from req are replaced with values taken from an SRV record if any such record
internal/httpproxy/backend.go:128
Method
Flush
()
logging.go:50
Method
Header
()
logging.go:37
Function
TestAllowedAnon
(t *testing.T)
main_test.go:168
Function
TestAllowedGroup
(t *testing.T)
main_test.go:139
Function
TestBadSecret
(t *testing.T)
main_test.go:111
Function
TestForbiddenAnon
(t *testing.T)
main_test.go:153
Function
TestForbiddenGroup
(t *testing.T)
main_test.go:125
Function
TestInvalidPayloadFails
(t *testing.T)
main_test.go:190
Function
TestInvalidSecretFails
(t *testing.T)
main_test.go:183
Function
TestNotWhitelistedPath
(t *testing.T)
main_test.go:206
Function
TestValidPayload
(t *testing.T)
main_test.go:197
Function
TestWhitelistedPath
(t *testing.T)
main_test.go:214
Function
TestWhitelistedPrefixPath
(t *testing.T)
main_test.go:222
Method
WriteHeader
(statusCode int)
logging.go:45
Function
main
()
main.go:42