(token codersdk.APIKey, owner string)
| 175 | } |
| 176 | |
| 177 | func tokenListRowFromKey(token codersdk.APIKey, owner string) tokenListRow { |
| 178 | return tokenListRow{ |
| 179 | APIKey: token, |
| 180 | ID: token.ID, |
| 181 | TokenName: token.TokenName, |
| 182 | Scopes: joinScopes(token.Scopes), |
| 183 | Allow: joinAllowList(token.AllowList), |
| 184 | LastUsed: token.LastUsed, |
| 185 | ExpiresAt: token.ExpiresAt, |
| 186 | CreatedAt: token.CreatedAt, |
| 187 | Owner: owner, |
| 188 | } |
| 189 | } |
| 190 | |
| 191 | func joinScopes(scopes []codersdk.APIKeyScope) string { |
| 192 | if len(scopes) == 0 { |
no test coverage detected