Skip to content

Commit

Permalink
Add maxItems:10 for SearchLogQuery
Browse files Browse the repository at this point in the history
Signed-off-by: Priya Wadhwa <priya@chainguard.dev>
  • Loading branch information
priyawadhwa committed Aug 29, 2022
1 parent 36dfbda commit 28a4447
Show file tree
Hide file tree
Showing 67 changed files with 261 additions and 157 deletions.
7 changes: 5 additions & 2 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -519,21 +519,24 @@ definitions:
properties:
entryUUIDs:
type: array
minItems: 1
maxItems: 10
items:
type: string
minItems: 1
pattern: '^([0-9a-fA-F]{64}|[0-9a-fA-F]{80})$'
logIndexes:
type: array
minItems: 1
maxItems: 10
items:
type: integer
minimum: 0
entries:
type: array
minItems: 1
maxItems: 10
items:
$ref: '#/definitions/ProposedEntry'
minItems: 1

LogInfo:
type: object
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/entries.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ func SearchLogQueryHandler(params entries.SearchLogQueryParams) middleware.Respo

totalQueries := len(params.Entry.EntryUUIDs) + len(params.Entry.Entries()) + len(params.Entry.LogIndexes)
if totalQueries > maxSearchQueries {
return handleRekorAPIError(params, http.StatusBadRequest, fmt.Errorf(maxSearchQueryLimit, maxSearchQueries), maxSearchQueryLimit, maxSearchQueries)
return handleRekorAPIError(params, http.StatusUnprocessableEntity, fmt.Errorf(maxSearchQueryLimit, maxSearchQueries), maxSearchQueryLimit, maxSearchQueries)
}

if len(params.Entry.EntryUUIDs) > 0 || len(params.Entry.Entries()) > 0 {
Expand Down
8 changes: 5 additions & 3 deletions pkg/generated/client/entries/create_log_entry_parameters.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 8 additions & 4 deletions pkg/generated/client/entries/create_log_entry_responses.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 6 additions & 7 deletions pkg/generated/client/entries/entries_client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions pkg/generated/client/entries/search_log_query_parameters.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions pkg/generated/client/entries/search_log_query_responses.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/generated/client/index/index_client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions pkg/generated/client/index/search_index_parameters.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions pkg/generated/client/index/search_index_responses.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions pkg/generated/client/pubkey/get_public_key_parameters.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions pkg/generated/client/pubkey/get_public_key_responses.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/generated/client/pubkey/pubkey_client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions pkg/generated/client/server/get_rekor_version_parameters.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 28a4447

Please sign in to comment.