Chore: move from xorm to sqlx apikey store (#53434)

* migrate from xorm to sqlx

* fix tests

* fix comments

* fix some comments on the PR

* fix CI

* fix the comments
This commit is contained in:
ying-jeanne
2022-08-23 11:01:35 -04:00
committed by GitHub
parent 45b65cc6c9
commit ebcdf402b2
13 changed files with 457 additions and 264 deletions
+4 -1
View File
@@ -306,7 +306,10 @@ func (hs *HTTPServer) getNavTree(c *models.ReqContext, hasEditPerm bool, prefs *
}
hideApiKeys, _, _ := hs.kvStore.Get(c.Req.Context(), c.OrgID, "serviceaccounts", "hideApiKeys")
apiKeys := hs.apiKeyService.GetAllAPIKeys(c.Req.Context(), c.OrgID)
apiKeys, err := hs.apiKeyService.GetAllAPIKeys(c.Req.Context(), c.OrgID)
if err != nil {
return navTree, err
}
apiKeysHidden := hideApiKeys == "1" && len(apiKeys) == 0
if hasAccess(ac.ReqOrgAdmin, apiKeyAccessEvaluator) && !apiKeysHidden {
configNodes = append(configNodes, &dtos.NavLink{