Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: upgrade go fn sdk to v0.23.0 #39

Merged
merged 1 commit into from
Nov 13, 2024
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
8 changes: 4 additions & 4 deletions functions/Func_Jobs/api/audit.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,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 @@ -79,9 +79,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 @@ -27,13 +27,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 @@ -41,7 +41,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 @@ -80,7 +80,7 @@ func (h *JobsHandler) jobDetails(ctx context.Context, request *fdk.Request, clie
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 @@ -92,8 +92,8 @@ func (h *JobsHandler) jobDetails(ctx context.Context, request *fdk.Request, clie
}
}

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-scalable-rtr/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.4.3-0.20231013182855-e96a02e115d9
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-scalable-rtr/functions/job_history
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
Loading