- Notifications
You must be signed in to change notification settings - Fork1k
Commitc65996a
feat: add user_secrets table (#19162)
Closescoder/internal#780## Summary of changes:- added `user_secrets` table- `user_secrets` table contains `env_name` and `file_path` fields whichare not used at the moment, but will be used in later PRs- `user_secrets` table doesn't contain `value_key_id`, I will add it ina separate migration in a dbcrypt PR- on one hand I don't want to add fields which are not used (becauseit's a risk smth may change in implementation later), on the other handI don't want to add too many migrations for user secrets table- added unique sql indexes- added sql queries for CRUD operations on user-secrets- introduced new `ResourceUserSecret` resource- basic unit-tests for CRUD ops and authorization behavior- Role updates: - owner: - remove `ResourceUserSecret` from site-wide perms - add `ResourceUserSecret` to user-wide perms - orgAdmin- remove `ResourceUserSecret` from org-wide perms; seems it's notstrictly required, because `ResourceUserSecret` is not tied toorganization in dbauthz wrappers? - memberRole- no need to change memberRole because it implicitly has access touser-secrets thanks to the `allPermsExcept` - is it enough changes to roles? Main questions:- [ ] We will have 2 migrations for user-secrets: - initial migration (in current PR) - adding `value_key_id` in dbcrypt PR - is this approach reasonable?- [ ] Are changes to roles's permissions are correct?- [ ] Are changes in roles_test.go are correct?---------Co-authored-by: Steven Masley <Emyrk@users.noreply.github.com>1 parent34c46c0 commitc65996a
File tree
28 files changed
+913
-3
lines changed- coderd
- apidoc
- database
- dbauthz
- dbgen
- dbmetrics
- dbmock
- migrations
- testdata/fixtures
- queries
- rbac
- policy
- codersdk
- docs/reference/api
- site/src/api
28 files changed
+913
-3
lines changedSome generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1387 | 1387 |
| |
1388 | 1388 |
| |
1389 | 1389 |
| |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
1390 | 1398 |
| |
1391 | 1399 |
| |
1392 | 1400 |
| |
| |||
1657 | 1665 |
| |
1658 | 1666 |
| |
1659 | 1667 |
| |
| 1668 | + | |
| 1669 | + | |
| 1670 | + | |
| 1671 | + | |
| 1672 | + | |
| 1673 | + | |
| 1674 | + | |
| 1675 | + | |
| 1676 | + | |
| 1677 | + | |
| 1678 | + | |
| 1679 | + | |
| 1680 | + | |
1660 | 1681 |
| |
1661 | 1682 |
| |
1662 | 1683 |
| |
| |||
3075 | 3096 |
| |
3076 | 3097 |
| |
3077 | 3098 |
| |
| 3099 | + | |
| 3100 | + | |
| 3101 | + | |
| 3102 | + | |
| 3103 | + | |
| 3104 | + | |
| 3105 | + | |
| 3106 | + | |
| 3107 | + | |
| 3108 | + | |
| 3109 | + | |
| 3110 | + | |
| 3111 | + | |
| 3112 | + | |
| 3113 | + | |
| 3114 | + | |
| 3115 | + | |
| 3116 | + | |
| 3117 | + | |
| 3118 | + | |
| 3119 | + | |
| 3120 | + | |
3078 | 3121 |
| |
3079 | 3122 |
| |
3080 | 3123 |
| |
| |||
4153 | 4196 |
| |
4154 | 4197 |
| |
4155 | 4198 |
| |
| 4199 | + | |
| 4200 | + | |
| 4201 | + | |
| 4202 | + | |
| 4203 | + | |
| 4204 | + | |
| 4205 | + | |
| 4206 | + | |
4156 | 4207 |
| |
4157 | 4208 |
| |
4158 | 4209 |
| |
| |||
4866 | 4917 |
| |
4867 | 4918 |
| |
4868 | 4919 |
| |
| 4920 | + | |
| 4921 | + | |
| 4922 | + | |
| 4923 | + | |
| 4924 | + | |
| 4925 | + | |
| 4926 | + | |
| 4927 | + | |
| 4928 | + | |
| 4929 | + | |
| 4930 | + | |
| 4931 | + | |
| 4932 | + | |
4869 | 4933 |
| |
4870 | 4934 |
| |
4871 | 4935 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5883 | 5883 |
| |
5884 | 5884 |
| |
5885 | 5885 |
| |
| 5886 | + | |
| 5887 | + | |
| 5888 | + | |
| 5889 | + | |
| 5890 | + | |
| 5891 | + | |
| 5892 | + | |
| 5893 | + | |
| 5894 | + | |
| 5895 | + | |
| 5896 | + | |
| 5897 | + | |
| 5898 | + | |
| 5899 | + | |
| 5900 | + | |
| 5901 | + | |
| 5902 | + | |
| 5903 | + | |
| 5904 | + | |
| 5905 | + | |
| 5906 | + | |
| 5907 | + | |
| 5908 | + | |
| 5909 | + | |
| 5910 | + | |
| 5911 | + | |
| 5912 | + | |
| 5913 | + | |
| 5914 | + | |
| 5915 | + | |
| 5916 | + | |
| 5917 | + | |
| 5918 | + | |
| 5919 | + | |
| 5920 | + | |
| 5921 | + | |
| 5922 | + | |
| 5923 | + | |
| 5924 | + | |
| 5925 | + | |
| 5926 | + | |
| 5927 | + | |
| 5928 | + | |
| 5929 | + | |
| 5930 | + | |
| 5931 | + | |
| 5932 | + | |
| 5933 | + | |
| 5934 | + | |
| 5935 | + | |
| 5936 | + | |
| 5937 | + | |
| 5938 | + | |
| 5939 | + | |
| 5940 | + | |
| 5941 | + | |
| 5942 | + | |
| 5943 | + | |
| 5944 | + | |
| 5945 | + | |
| 5946 | + |
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1422 | 1422 |
| |
1423 | 1423 |
| |
1424 | 1424 |
| |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
1425 | 1439 |
| |
1426 | 1440 |
| |
1427 | 1441 |
| |
|
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.
0 commit comments
Comments
(0)