Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions roles/roles.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,18 @@ var (
}
)

// services.ReleaseOperations
var (
RoleReleaseOperationsAdmin = ToRole(services.ReleaseOperations, "release_admin")
releaseOperationsRoles = []roleInfo{
{
id: RoleReleaseOperationsAdmin,
service: services.ReleaseOperations,
resourceType: Service,
},
}
)

var registeredRoles = func() []roleInfo {
var registered []roleInfo

Expand All @@ -159,6 +171,7 @@ var registeredRoles = func() []roleInfo {
appendRoles(sscRoles)
appendRoles(enterprisePortalRoles)
appendRoles(workspacesRoles)
appendRoles(releaseOperationsRoles)
// 👉 ADD YOUR ROLES HERE

return registered
Expand Down
2 changes: 2 additions & 0 deletions roles/roles_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ func TestGoldenList(t *testing.T) {
autogold.Expect([]Role{
Role("dotcom::site_admin"), Role("enterprise_portal::customer_admin"),
Role("enterprise_portal::service_admin"),
Role("releaseoperations::release_admin"),
Role("ssc::admin"),
Role("workspaces::service_admin"),
}).Equal(t, got)
Expand Down Expand Up @@ -86,6 +87,7 @@ func TestRolesByResourceType(t *testing.T) {
resource: Service,
expected: autogold.Expect([]Role{
Role("dotcom::site_admin"), Role("enterprise_portal::service_admin"),
Role("releaseoperations::release_admin"),
Role("ssc::admin"),
Role("workspaces::service_admin"),
}),
Expand Down
46 changes: 24 additions & 22 deletions services/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,33 @@ type Service string

// The list of registered services that publish scopes and/or roles.
const (
Amp Service = "amp"
CodyGateway Service = "cody_gateway"
Dotcom Service = "dotcom"
SAMS Service = "sams"
TelemetryGateway Service = "telemetry_gateway"
EnterprisePortal Service = "enterprise_portal"
MailGatekeeper Service = "mail_gatekeeper"
Workspaces Service = "workspaces"
SSC Service = "ssc"
Analytics Service = "analytics"
CloudAPI Service = "cloud_api"
Amp Service = "amp"
CodyGateway Service = "cody_gateway"
Dotcom Service = "dotcom"
SAMS Service = "sams"
TelemetryGateway Service = "telemetry_gateway"
EnterprisePortal Service = "enterprise_portal"
MailGatekeeper Service = "mail_gatekeeper"
Workspaces Service = "workspaces"
SSC Service = "ssc"
Analytics Service = "analytics"
CloudAPI Service = "cloud_api"
ReleaseOperations Service = "releaseoperations"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would release_operations be more in line with the existing services?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This matches the other release services, which started with releaseregistry. I know it's kind of against the format for everything else, but at this point we kind of have our own standard on the release stuff for better or worse.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think in this case you should follow the SAMS SDK convention 🙏 It doesn't affect your existing naming elsewhere

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed - #105

)

var serviceNames = map[Service]string{
Amp: "Amp",
CodyGateway: "Cody Gateway",
Dotcom: "Sourcegraph Dotcom",
SAMS: "Sourcegraph Accounts Management System",
TelemetryGateway: "Telemetry Gateway",
EnterprisePortal: "Enterprise Portal",
MailGatekeeper: "Mail Gatekeeper",
Workspaces: "Workspaces",
SSC: "Self Serve Cody",
Analytics: "Sourcegraph Analytics",
CloudAPI: "Cloud API",
Amp: "Amp",
CodyGateway: "Cody Gateway",
Dotcom: "Sourcegraph Dotcom",
SAMS: "Sourcegraph Accounts Management System",
TelemetryGateway: "Telemetry Gateway",
EnterprisePortal: "Enterprise Portal",
MailGatekeeper: "Mail Gatekeeper",
Workspaces: "Workspaces",
SSC: "Self Serve Cody",
Analytics: "Sourcegraph Analytics",
CloudAPI: "Cloud API",
ReleaseOperations: "Release Operations",
}

func (s Service) DisplayName() string {
Expand Down
Loading