Skip to content

Commit

Permalink
imports
Browse files Browse the repository at this point in the history
  • Loading branch information
andoriyaprashant committed Jan 18, 2025
1 parent f5cf97f commit 6329562
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func generateJWTTokenFromClaims(claims jwt.MapClaims) (string, error) {
}

func FuzzUserValidateJWT(f *testing.F) {
operator := &Operator{}
operator := &Operator{}
f.Fuzz(func(t *testing.T, data []byte) {
fuzzConsumer := fuzz.NewConsumer(data)
inputClaims := &jwt.MapClaims{}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,16 @@ type Service interface {
}

type infraService struct {
infraOperator *dbChaosInfra.Operator
envOperator *dbEnvironments.Operator
infraOperator *dbChaosInfra.Operator
envOperator *dbEnvironments.Operator
authConfigOperator *authorization.Operator
}

// NewChaosInfrastructureService returns a new instance of Service
func NewChaosInfrastructureService(infraOperator *dbChaosInfra.Operator, envOperator *dbEnvironments.Operator, authConfigOperator *authorization.Operator) Service {
return &infraService{
infraOperator: infraOperator,
envOperator: envOperator,
infraOperator: infraOperator,
envOperator: envOperator,
authConfigOperator: authConfigOperator,
}
}
Expand Down
13 changes: 6 additions & 7 deletions chaoscenter/graphql/server/pkg/chaoshub/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,17 @@ type Service interface {
GetChaosHubStats(ctx context.Context, projectID string) (*model.GetChaosHubStatsResponse, error)
}


type chaosHubService struct {
chaosHubOperator *dbSchemaChaosHub.Operator
authConfigOperator *authorization.Operator
chaosHubOperator *dbSchemaChaosHub.Operator
authConfigOperator *authorization.Operator
}

// NewService returns a new instance of Service
func NewService(chaosHubOperator *dbSchemaChaosHub.Operator, authConfigOperator *authorization.Operator) Service {
return &chaosHubService{
chaosHubOperator: chaosHubOperator,
authConfigOperator: authConfigOperator,
}
return &chaosHubService{
chaosHubOperator: chaosHubOperator,
authConfigOperator: authConfigOperator,
}
}

// AddChaosHub is used for Adding a new ChaosHub
Expand Down
2 changes: 1 addition & 1 deletion chaoscenter/graphql/server/pkg/handlers/file_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
func FileHandler(mongodbOperator mongodb.MongoOperator) gin.HandlerFunc {
return func(c *gin.Context) {
token := strings.TrimSuffix(c.Param("key"), ".yaml")
chaosInfraOperator := chaos_infrastructure.NewChaosInfrastructureOperator(mongodbOperator)
chaosInfraOperator := chaos_infrastructure.NewChaosInfrastructureOperator(mongodbOperator)
infraId, err := chaosInfraOperator.InfraValidateJWT(token)
if err != nil {
logrus.Error("Error validating JWT: ", err)
Expand Down
32 changes: 16 additions & 16 deletions chaoscenter/graphql/server/pkg/probe/handler/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,20 @@ import (
)

type Service interface {
AddProbe(ctx context.Context, probe model.ProbeRequest, projectID string) (*model.Probe, error)
UpdateProbe(ctx context.Context, probe model.ProbeRequest, projectID string) (string, error)
ListProbes(ctx context.Context, probeNames []string, infrastructureType *model.InfrastructureType, filter *model.ProbeFilterInput, projectID string) ([]*model.Probe, error)
DeleteProbe(ctx context.Context, probeName, projectID string) (bool, error)
GetProbe(ctx context.Context, probeName, projectID string) (*model.Probe, error)
GetProbeReference(ctx context.Context, probeName, projectID string) (*model.GetProbeReferenceResponse, error)
GetProbeYAMLData(ctx context.Context, probe model.GetProbeYAMLRequest, projectID string) (string, error)
ValidateUniqueProbe(ctx context.Context, probeName, projectID string) (bool, error)
GenerateExperimentManifestWithProbes(manifest string, projectID string) (argoTypes.Workflow, error)
GenerateCronExperimentManifestWithProbes(manifest string, projectID string) (argoTypes.CronWorkflow, error)
AddProbe(ctx context.Context, probe model.ProbeRequest, projectID string) (*model.Probe, error)
UpdateProbe(ctx context.Context, probe model.ProbeRequest, projectID string) (string, error)
ListProbes(ctx context.Context, probeNames []string, infrastructureType *model.InfrastructureType, filter *model.ProbeFilterInput, projectID string) ([]*model.Probe, error)
DeleteProbe(ctx context.Context, probeName, projectID string) (bool, error)
GetProbe(ctx context.Context, probeName, projectID string) (*model.Probe, error)
GetProbeReference(ctx context.Context, probeName, projectID string) (*model.GetProbeReferenceResponse, error)
GetProbeYAMLData(ctx context.Context, probe model.GetProbeYAMLRequest, projectID string) (string, error)
ValidateUniqueProbe(ctx context.Context, probeName, projectID string) (bool, error)
GenerateExperimentManifestWithProbes(manifest string, projectID string) (argoTypes.Workflow, error)
GenerateCronExperimentManifestWithProbes(manifest string, projectID string) (argoTypes.CronWorkflow, error)
}

type probeService struct {
probeOperator *dbSchemaProbe.Operator
probeOperator *dbSchemaProbe.Operator
authConfigOperator *authorization.Operator
}

Expand All @@ -60,10 +60,10 @@ func NewProbeOperator(mongodbOperator mongodb.MongoOperator) *Operator {

// NewProbeService returns a new instance of probeService
func NewProbeService(probeOperator *dbSchemaProbe.Operator, authConfigOperator *authorization.Operator) Service {
return &probeService{
probeOperator: probeOperator,
authConfigOperator: authConfigOperator,
}
return &probeService{
probeOperator: probeOperator,
authConfigOperator: authConfigOperator,
}
}

func Error(logFields logrus.Fields, message string) error {
Expand Down Expand Up @@ -401,7 +401,7 @@ func (p *probeService) ListProbes(ctx context.Context, probeNames []string, infr

func GetProbeExecutionHistoryInExperimentRuns(projectID string, probeName string) ([]*model.ProbeRecentExecutions, error) {
var mongodbOperator mongodb.MongoOperator

var (
pipeline mongo.Pipeline
expRuns []dbChaosExperimentRun.ChaosExperimentRun
Expand Down

0 comments on commit 6329562

Please sign in to comment.