Skip to content

Commit 353ef76

Browse files
committed
Merge branch 'main' into org-management-ui
2 parents 3bab8cb + dd99897 commit 353ef76

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+809
-3365
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ jobs:
170170
171171
# Check for any typos
172172
- name: Check for typos
173-
uses: crate-ci/typos@v1.21.0
173+
uses: crate-ci/typos@v1.22.3
174174
with:
175175
config: .github/workflows/typos.toml
176176

.github/workflows/security.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ jobs:
114114
echo "image=$(cat "$image_job")" >> $GITHUB_OUTPUT
115115
116116
- name: Run Trivy vulnerability scanner
117-
uses: aquasecurity/trivy-action@fd25fed6972e341ff0007ddb61f77e88103953c2
117+
uses: aquasecurity/trivy-action@595be6a0f6560a0a8fc419ddf630567fc623531d
118118
with:
119119
image-ref: ${{ steps.build.outputs.image }}
120120
format: sarif

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,4 +125,4 @@ contributions!
125125

126126
## Hiring
127127

128-
Apply [here](https://cdr.co/github-apply) if you're interested in joining our team.
128+
Apply [here](https://jobs.ashbyhq.com/coder?utm_source=github&utm_medium=readme&utm_campaign=unknown) if you're interested in joining our team.

cli/server_createadminuser.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ func (r *RootCmd) newCreateAdminUserCommand() *serpent.Command {
192192
HashedPassword: []byte(hashedPassword),
193193
CreatedAt: dbtime.Now(),
194194
UpdatedAt: dbtime.Now(),
195-
RBACRoles: []string{rbac.RoleOwner()},
195+
RBACRoles: []string{rbac.RoleOwner().String()},
196196
LoginType: database.LoginTypePassword,
197197
})
198198
if err != nil {
@@ -222,7 +222,7 @@ func (r *RootCmd) newCreateAdminUserCommand() *serpent.Command {
222222
UserID: newUser.ID,
223223
CreatedAt: dbtime.Now(),
224224
UpdatedAt: dbtime.Now(),
225-
Roles: []string{rbac.ScopedRoleOrgAdmin(org.ID)},
225+
Roles: []string{rbac.RoleOrgAdmin()},
226226
})
227227
if err != nil {
228228
return xerrors.Errorf("insert organization member: %w", err)

cli/server_createadminuser_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import (
1717
"github.com/coder/coder/v2/coderd/database/dbtime"
1818
"github.com/coder/coder/v2/coderd/rbac"
1919
"github.com/coder/coder/v2/coderd/userpassword"
20+
"github.com/coder/coder/v2/codersdk"
2021
"github.com/coder/coder/v2/pty/ptytest"
2122
"github.com/coder/coder/v2/testutil"
2223
)
@@ -56,7 +57,7 @@ func TestServerCreateAdminUser(t *testing.T) {
5657
require.NoError(t, err)
5758
require.True(t, ok, "password does not match")
5859

59-
require.EqualValues(t, []string{rbac.RoleOwner()}, user.RBACRoles, "user does not have owner role")
60+
require.EqualValues(t, []string{codersdk.RoleOwner}, user.RBACRoles, "user does not have owner role")
6061

6162
// Check that user is admin in every org.
6263
orgs, err := db.GetOrganizations(ctx)
@@ -71,7 +72,7 @@ func TestServerCreateAdminUser(t *testing.T) {
7172
orgIDs2 := make(map[uuid.UUID]struct{}, len(orgMemberships))
7273
for _, membership := range orgMemberships {
7374
orgIDs2[membership.OrganizationID] = struct{}{}
74-
assert.Equal(t, []string{rbac.ScopedRoleOrgAdmin(membership.OrganizationID)}, membership.Roles, "user is not org admin")
75+
assert.Equal(t, []string{rbac.RoleOrgAdmin()}, membership.Roles, "user is not org admin")
7576
}
7677

7778
require.Equal(t, orgIDs, orgIDs2, "user is not in all orgs")

0 commit comments

Comments
 (0)