authz: add new `Store` type to manage permissions
Created by: unknwon
This PR adds a new Store
type to the enterprise/cmd/frontend/internal/authz, is part of the RFC 40: Explicit Repository Permissions Model (AKA "The Sourcegraph Authz Provider") (#6086 (closed)).
This Store
provides a unified interface (a set of methods) for DB operations over permissions tables:
user_permissions
repo_permssions
user_pending_permissions
repo_pending_permissions
Review Tips
- Encouraged to review by commits, in particular:
- Update site config schema
- Add DB migration scripts
- Add site alert about conflicts between code host authz provider(s) and this new Sourcegraph Authz Provider (no real action is taken here, will do that in later PRs)
- Initial implementation of
Store
type
Notes
authz/bitbucketserver.store
Compatibility with existing The design of this package has taken this into account, here is the PoC PR that shows how we could reuse this Store
type in Bitbucket Server Authz Provider (it's outdated with refactoring of internal/authz
package, but it's a PoC anyway).
Test plan
-
Unit tests -
Site alert