MCPcopy Index your code
hub / github.com/coder/coder / PrintAnalysis

Function PrintAnalysis

coderd/authlink/authlink.go:115–135  ·  view source on GitHub ↗

PrintAnalysis writes a human-readable summary of the OIDC link analysis. Used for the cli command and debugging.

(w io.Writer, analysis OIDCLinkAnalysis, issuer string)

Source from the content-addressed store, hash-verified

113// PrintAnalysis writes a human-readable summary of the OIDC link analysis.
114// Used for the cli command and debugging.
115func PrintAnalysis(w io.Writer, analysis OIDCLinkAnalysis, issuer string) {
116 _, _ = fmt.Fprintf(w, "OIDC Link Analysis (issuer: %s)\n", issuer)
117 _, _ = fmt.Fprintf(w, " Total OIDC users: %d\n", analysis.Total)
118 _, _ = fmt.Fprintf(w, " Correctly linked: %d\n", analysis.CorrectIssuer)
119 _, _ = fmt.Fprintf(w, " Unlinked (empty linked_id): %d\n", analysis.Unlinked)
120
121 mismatchedTotal := analysis.MismatchedTotal()
122 _, _ = fmt.Fprintf(w, " Linked to other issuers: %d\n", mismatchedTotal)
123
124 if mismatchedTotal > 0 {
125 // Sort issuer keys for deterministic output.
126 issuers := make([]string, 0, len(analysis.MismatchedCounts))
127 for issuer := range analysis.MismatchedCounts {
128 issuers = append(issuers, issuer)
129 }
130 sort.Strings(issuers)
131 for _, iss := range issuers {
132 _, _ = fmt.Fprintf(w, " %s: %d\n", iss, analysis.MismatchedCounts[iss])
133 }
134 }
135}

Callers 1

Calls 2

MismatchedTotalMethod · 0.80
StringsMethod · 0.80

Tested by

no test coverage detected