Documentation ¶
Index ¶
- func CopyHeader(dst, src http.Header)
- func GetJwks(ctx context.Context, location string) (jwk.Set, error)
- func HeaderParser(values string) (retMap map[string]string)
- func LaunchPeriodicWriteCABundle(ctx context.Context, filename string, sleepTime time.Duration) (count int, err error)
- func MakeRequest(ctx context.Context, url string, method string, data map[string]interface{}, ...) ([]byte, error)
- func SnakeCaseToCamelCase(input string) string
- func SnakeCaseToHumanReadable(input string) string
- func WriteCABundle(filename string) (int, error)
- type CredentialGeneration
- type Namespace
- type Scitokens
- type Server
- type TopologyNamespacesJSON
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyHeader ¶
Copy headers from proxied src to dst, removing those defined by HTTP as "hop-by-hop" and not to be forwarded (see https://www.rfc-editor.org/rfc/rfc9110#field.connection)
func HeaderParser ¶
Simple parser to that takes a "values" string from a header and turns it into a map of key/value pairs
func LaunchPeriodicWriteCABundle ¶
func LaunchPeriodicWriteCABundle(ctx context.Context, filename string, sleepTime time.Duration) (count int, err error)
Periodically write out the system CAs, updating them if the system updates. Returns an error if the first attempt at writing fails. Otherwise, it will launch a goroutine and update the entire CA bundle every specified duration.
If we're on a platform (Mac, Windows) that does not provide a CA bundle, we return a count of 0 and do not launch the go routine.
func MakeRequest ¶
func MakeRequest(ctx context.Context, url string, method string, data map[string]interface{}, headers map[string]string) ([]byte, error)
MakeRequest makes an http request with our custom http client. It acts similarly to the http.NewRequest but it only takes json as the request data.
func SnakeCaseToCamelCase ¶
snakeCaseToCamelCase converts a snake case string to camel case.
func SnakeCaseToHumanReadable ¶
snakeCaseToSnakeCase converts a snake_case string to Snake Case (CamelCase with spaces).
func WriteCABundle ¶
Write out all the trusted CAs as a CA bundle on disk. This is useful for components that do not use go's trusted CA store
Types ¶
type CredentialGeneration ¶
type Namespace ¶
type Namespace struct { Caches []Server `json:"caches"` Origins []Server `json:"origins"` CredentialGeneration CredentialGeneration `json:"credential_generation"` DirlistHost string `json:"dirlisthost"` Path string `json:"path"` ReadHTTPS bool `json:"readhttps"` Scitokens []Scitokens `json:"scitokens"` UseTokenOnRead bool `json:"usetokenonread"` WritebackHost string `json:"writebackhost"` }
type TopologyNamespacesJSON ¶
type TopologyNamespacesJSON struct { Caches []Server `json:"caches"` Namespaces []Namespace `json:"namespaces"` }
func GetTopologyJSON ¶
func GetTopologyJSON() (*TopologyNamespacesJSON, error)
GetTopologyJSON returns the namespaces and caches from OSDF topology