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
2 changes: 2 additions & 0 deletions cmd/permission.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ func viewPermissionCommand(cliConfig *Config) *cli.Command {
spinner.Stop()

report = append(report, []string{"ID", "NAME", "NAMESPACE"})
//nolint:staticcheck
report = append(report, []string{
action.GetId(),
action.GetName(),
Expand Down Expand Up @@ -247,6 +248,7 @@ func listPermissionCommand(cliConfig *Config) *cli.Command {
fmt.Printf(" \nShowing %d permission(s)\n \n", len(permissions))

report = append(report, []string{"ID", "NAME", "NAMESPACE"})
//nolint:staticcheck
for _, a := range permissions {
report = append(report, []string{
a.GetId(),
Expand Down
1 change: 1 addition & 0 deletions cmd/seed.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ func createCustomRolesAndPermissions(ctx context.Context, client frontierv1beta1
}

str := "created custom permissions : "
//nolint:staticcheck
for _, v := range permissionBodies {
str = fmt.Sprintf("%s %s:%s", str, v.GetNamespace(), v.GetName())
resourceNamespaces = append(resourceNamespaces, v.GetNamespace())
Expand Down
2 changes: 1 addition & 1 deletion cmd/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ func buildAPIDependencies(

authzSchemaRepository := spicedb.NewSchemaRepository(logger, sdb)
consistencyLevel := spicedb.ConsistencyLevel(cfg.SpiceDB.Consistency)
if cfg.SpiceDB.FullyConsistent {
if cfg.SpiceDB.FullyConsistent { //nolint:staticcheck
consistencyLevel = spicedb.ConsistencyLevelFull
}
if !slices.Contains([]spicedb.ConsistencyLevel{
Expand Down
1 change: 1 addition & 0 deletions internal/api/v1beta1connect/billing_subscription.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ func (h *ConnectHandler) CancelSubscription(ctx context.Context, request *connec
}

func (h *ConnectHandler) ChangeSubscription(ctx context.Context, request *connect.Request[frontierv1beta1.ChangeSubscriptionRequest]) (*connect.Response[frontierv1beta1.ChangeSubscriptionResponse], error) {
//nolint:staticcheck
changeReq := subscription.ChangeRequest{
PlanID: request.Msg.GetPlan(),
Immediate: request.Msg.GetImmediate(),
Expand Down
1 change: 1 addition & 0 deletions internal/api/v1beta1connect/billing_usage.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ func (h *ConnectHandler) ListBillingTransactions(ctx context.Context, request *c

var transactions []*frontierv1beta1.BillingTransaction
var startRange time.Time
//nolint:staticcheck
if request.Msg.GetSince() != nil {
startRange = request.Msg.GetSince().AsTime()
}
Expand Down
4 changes: 2 additions & 2 deletions internal/api/v1beta1connect/permission.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func (h *ConnectHandler) CreatePermission(ctx context.Context, request *connect.
for _, permBody := range request.Msg.GetBodies() {
permNamespace, permName := schema.PermissionNamespaceAndNameFromKey(permBody.GetKey())
if permNamespace == "" || permName == "" {
permNamespace, permName = permBody.GetNamespace(), permBody.GetName()
permNamespace, permName = permBody.GetNamespace(), permBody.GetName() //nolint:staticcheck
}
if permName == "" || permNamespace == "" {
return nil, connect.NewError(connect.CodeInvalidArgument, ErrBadRequest)
Expand Down Expand Up @@ -116,7 +116,7 @@ func (h *ConnectHandler) UpdatePermission(ctx context.Context, request *connect.

permNamespace, permName := schema.PermissionNamespaceAndNameFromKey(request.Msg.GetBody().GetKey())
if permNamespace == "" || permName == "" {
permNamespace, permName = request.Msg.GetBody().GetNamespace(), request.Msg.GetBody().GetName()
permNamespace, permName = request.Msg.GetBody().GetNamespace(), request.Msg.GetBody().GetName() //nolint:staticcheck
}
updatedPermission, err := h.permissionService.Update(ctx, permission.Permission{
ID: request.Msg.GetId(),
Expand Down
1 change: 1 addition & 0 deletions internal/api/v1beta1connect/permission_check.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ func (h *ConnectHandler) CheckResourcePermission(ctx context.Context, req *conne
errorLogger := NewErrorLogger()

objectNamespace, objectID, err := schema.SplitNamespaceAndResourceID(req.Msg.GetResource())
//nolint:staticcheck
if len(req.Msg.GetResource()) == 0 || err != nil {
objectNamespace = schema.ParseNamespaceAliasIfRequired(req.Msg.GetObjectNamespace())
objectID = req.Msg.GetObjectId()
Expand Down
1 change: 1 addition & 0 deletions internal/reconcile/permission_reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ func (r *PermissionReconciler) fetchCurrent(ctx context.Context) ([]currentPermi
return nil, fmt.Errorf("list permissions: %w", err)
}
var current []currentPermission
//nolint:staticcheck
for _, p := range resp.Msg.GetPermissions() {
if isBaseNamespace(p.GetNamespace()) {
continue
Expand Down
2 changes: 1 addition & 1 deletion internal/store/spicedb/relation_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"sync/atomic"

authzedpb "github.com/authzed/authzed-go/proto/authzed/api/v1"
newrelic "github.com/newrelic/go-agent"
newrelic "github.com/newrelic/go-agent" //nolint:staticcheck
"github.com/raystack/frontier/core/relation"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

"github.com/raystack/frontier/internal/metrics"

newrelic "github.com/newrelic/go-agent"
newrelic "github.com/newrelic/go-agent" //nolint:staticcheck

"github.com/jmoiron/sqlx"
)
Expand Down
2 changes: 2 additions & 0 deletions test/e2e/regression/billing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1068,6 +1068,7 @@ func (s *BillingRegressionTestSuite) TestUsageAPI() {
beforeBalance := getBalanceResp.Msg.GetBalance().GetAmount()

// set limit to -20
//nolint:staticcheck
_, err = s.testBench.AdminClient.UpdateBillingAccountLimits(ctxOrgAdminAuth, connect.NewRequest(&frontierv1beta1.UpdateBillingAccountLimitsRequest{
OrgId: createOrgResp.Msg.GetOrganization().GetId(),
Id: createBillingResp.Msg.GetBillingAccount().GetId(),
Expand Down Expand Up @@ -1129,6 +1130,7 @@ func (s *BillingRegressionTestSuite) TestUsageAPI() {
s.Assert().NoError(err)

// reset limit
//nolint:staticcheck
_, err = s.testBench.AdminClient.UpdateBillingAccountLimits(ctxOrgAdminAuth, connect.NewRequest(&frontierv1beta1.UpdateBillingAccountLimitsRequest{
OrgId: createOrgResp.Msg.GetOrganization().GetId(),
Id: createBillingResp.Msg.GetBillingAccount().GetId(),
Expand Down
2 changes: 2 additions & 0 deletions test/e2e/regression/service_registration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ func (s *ServiceRegistrationRegressionTestSuite) TestServiceRegistration() {
var lastPermCount int
for _, perm := range []string{"get", "update", "delete"} {
for _, listPerm := range listPermResp.Msg.GetPermissions() {
//nolint:staticcheck
if listPerm.GetName() == perm && listPerm.GetNamespace() == "database/instance" {
lastPermCount++
}
Expand Down Expand Up @@ -235,6 +236,7 @@ func (s *ServiceRegistrationRegressionTestSuite) TestPermissionDeleteCascade() {
s.Require().NoError(err)
var builtinID string
for _, p := range listResp.Msg.GetPermissions() {
//nolint:staticcheck
if p.GetNamespace() == "app/organization" && p.GetName() == "get" {
builtinID = p.GetId()
break
Expand Down
Loading