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

Function ConvertAPIKey

coderd/telemetry/telemetry.go:1134–1146  ·  view source on GitHub ↗

ConvertAPIKey anonymizes an API key.

(apiKey database.APIKey)

Source from the content-addressed store, hash-verified

1132
1133// ConvertAPIKey anonymizes an API key.
1134func ConvertAPIKey(apiKey database.APIKey) APIKey {
1135 a := APIKey{
1136 ID: apiKey.ID,
1137 UserID: apiKey.UserID,
1138 CreatedAt: apiKey.CreatedAt,
1139 LastUsed: apiKey.LastUsed,
1140 LoginType: apiKey.LoginType,
1141 }
1142 if apiKey.IPAddress.Valid {
1143 a.IPAddress = apiKey.IPAddress.IPNet.IP
1144 }
1145 return a
1146}
1147
1148// ConvertWorkspace anonymizes a workspace.
1149func ConvertWorkspace(workspace database.Workspace) Workspace {

Callers 2

createAPIKeyMethod · 0.92
createSnapshotMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected