MCPcopy Create free account
hub / github.com/PatchMon/PatchMon / isMicrosoftGraphURL

Function isMicrosoftGraphURL

server-source-code/internal/auth/oidc/client.go:300–314  ·  view source on GitHub ↗

isMicrosoftGraphURL detects URLs pointing at Microsoft Graph, which require a bearer token and therefore cannot be used as a browser-renderable .

(value string)

Source from the content-addressed store, hash-verified

298// isMicrosoftGraphURL detects URLs pointing at Microsoft Graph, which require a
299// bearer token and therefore cannot be used as a browser-renderable <img src>.
300func isMicrosoftGraphURL(value string) bool {
301 if value == "" {
302 return false
303 }
304 u, err := url.Parse(value)
305 if err != nil {
306 return false
307 }
308 host := strings.ToLower(u.Hostname())
309 return host == "graph.microsoft.com" ||
310 strings.HasSuffix(host, ".graph.microsoft.com") ||
311 host == "graph.microsoft.us" ||
312 host == "graph.microsoft.de" ||
313 host == "microsoftgraph.chinacloudapi.cn"
314}
315
316func isMicrosoftIdentityIssuer(issuerURL string) bool {
317 u, err := url.Parse(issuerURL)

Calls

no outgoing calls