ConvertAPIKey anonymizes an API key.
(apiKey database.APIKey)
| 1132 | |
| 1133 | // ConvertAPIKey anonymizes an API key. |
| 1134 | func 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. |
| 1149 | func ConvertWorkspace(workspace database.Workspace) Workspace { |
no outgoing calls
no test coverage detected