Skip to content

Commit

Permalink
Merge pull request #45 from CrowdStrike/chore/update_go_sdk
Browse files Browse the repository at this point in the history
chore: adopt updated go sdk version v0.23.0
  • Loading branch information
jsteenb2 authored Nov 13, 2024
2 parents 3d4f2dd + dc8c6d4 commit fb5e9a3
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions functions/Func_Jobs/api/audit.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func (h *AuditsHandler) auditDetails(ctx context.Context, request *fdk.Request,
Limit: limit,
}

limitParam := request.Params.Query.Get(queryLimit)
limitParam := request.Queries.Get(queryLimit)
if limitParam != "" {
limit, err = strconv.Atoi(limitParam)
if err != nil {
Expand All @@ -80,9 +80,9 @@ func (h *AuditsHandler) auditDetails(ctx context.Context, request *fdk.Request,
}
}

nOffset := request.Params.Query.Get(queryPrevOffset)
qOffset := request.Params.Query.Get(queryNextOffset)
filter := request.Params.Query.Get(queryParamFilter)
nOffset := request.Queries.Get(queryPrevOffset)
qOffset := request.Queries.Get(queryNextOffset)
filter := request.Queries.Get(queryParamFilter)

if filter != "" {
pair := strings.Split(filter, ":")
Expand Down
4 changes: 2 additions & 2 deletions functions/Func_Jobs/api/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ func NewJobHandler(conf *models.Config) *JobHandler {

func (h *JobHandler) Handle(ctx context.Context, request fdk.Request) fdk.Response {
response := fdk.Response{}
if request.Params.Query == nil {
if request.Queries == nil {
response.Code = http.StatusBadRequest
response.Errors = append(response.Errors, fdk.APIError{Code: http.StatusBadRequest, Message: "Request does not have query params"})
return response
}

queryParams := request.Params.Query[queryIDParam]
queryParams := request.Queries[queryIDParam]
if len(queryParams) != 1 {
response.Code = http.StatusBadRequest
response.Errors = append(response.Errors, fdk.APIError{Code: http.StatusBadRequest, Message: fmt.Sprintf("query params %s length: %d is incorrect", queryIDParam, len(queryIDParam))})
Expand Down
2 changes: 1 addition & 1 deletion functions/Func_Jobs/api/job_upsert.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (h *UpsertJobHandler) Handle(ctx context.Context, request fdk.Request) fdk.
return response
}

queryParams := request.Params.Query.Get(queryIsDraft)
queryParams := request.Queries.Get(queryIsDraft)
if queryParams == "true" {
isDraft = true
}
Expand Down
6 changes: 3 additions & 3 deletions functions/Func_Jobs/api/jobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func (h *JobsHandler) jobDetails(ctx context.Context, request *fdk.Request, fc *
Limit: limit,
}

limitParam := request.Params.Query.Get(queryLimit)
limitParam := request.Queries.Get(queryLimit)
if limitParam != "" {
limit, err = strconv.Atoi(limitParam)
if err != nil {
Expand All @@ -93,8 +93,8 @@ func (h *JobsHandler) jobDetails(ctx context.Context, request *fdk.Request, fc *
}
}

nOffset := request.Params.Query.Get(queryPrevOffset)
qOffset := request.Params.Query.Get(queryNextOffset)
nOffset := request.Queries.Get(queryPrevOffset)
qOffset := request.Queries.Get(queryNextOffset)

if qOffset != "" && nOffset != "" {
return &response, []fdk.APIError{{
Expand Down
2 changes: 1 addition & 1 deletion functions/Func_Jobs/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/Crowdstrike/foundry-sample-rapid-response/functions/Func_Jobs
go 1.21

require (
github.com/CrowdStrike/foundry-fn-go v0.22.0
github.com/CrowdStrike/foundry-fn-go v0.23.0
github.com/crowdstrike/gofalcon v0.5.0-rc1.0.20231018211136-aa9a14d480c8
github.com/go-openapi/runtime v0.26.0
github.com/robfig/cron/v3 v3.0.1
Expand Down
2 changes: 1 addition & 1 deletion functions/job_history/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/Crowdstrike/foundry-sample-rapid-response/functions/job_histor
go 1.21

require (
github.com/CrowdStrike/foundry-fn-go v0.22.0
github.com/CrowdStrike/foundry-fn-go v0.23.0
github.com/crowdstrike/gofalcon v0.5.0-rc1.0.20231018211136-aa9a14d480c8
github.com/eapache/go-resiliency v1.4.0
github.com/robfig/cron/v3 v3.0.1
Expand Down
2 changes: 1 addition & 1 deletion functions/job_history/processor/processor_executions.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func NewExecutionsProcessor(strgc storagec.StorageC, logger logrus.FieldLogger,

// Process returns any job execution histories that match the provided request parameters.
func (p *ExecutionsProcessor) Process(ctx context.Context, req fdk.Request) Response {
queryParams := req.Params.Query
queryParams := req.Queries
if len(queryParams) == 0 {
queryParams = make(url.Values)
}
Expand Down

0 comments on commit fb5e9a3

Please sign in to comment.