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

Drop application/yaml content type #933

Merged
merged 3 commits into from
Jul 27, 2022
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: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ SERVER_LDFLAGS=$(REKOR_LDFLAGS)

Makefile.swagger: $(SWAGGER) $(OPENAPIDEPS)
$(SWAGGER) validate openapi.yaml
$(SWAGGER) generate client -f openapi.yaml -q -r COPYRIGHT.txt -t pkg/generated --default-consumes application/json\;q=1 --additional-initialism=TUF
$(SWAGGER) generate client -f openapi.yaml -q -r COPYRIGHT.txt -t pkg/generated --additional-initialism=TUF
$(SWAGGER) generate server -f openapi.yaml -q -r COPYRIGHT.txt -t pkg/generated --exclude-main -A rekor_server --flag-strategy=pflag --default-produces application/json --additional-initialism=TUF
@echo "# This file is generated after swagger runs as part of the build; do not edit!" > Makefile.swagger
@echo "SWAGGER_GEN=`find pkg/generated/client pkg/generated/models/ pkg/generated/restapi/ -iname '*.go' | grep -v 'configure_rekor_server' | sort -d | tr '\n' ' ' | sed 's/ $$//'`" >> Makefile.swagger;
Expand Down
4 changes: 1 addition & 3 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,8 @@ schemes:

consumes:
- application/json
- application/yaml
produces:
- application/json;q=1
- application/yaml
- application/json

paths:
/api/v1/version:
Expand Down
4 changes: 2 additions & 2 deletions pkg/client/rekor_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ func GetRekorClient(rekorServerURL string, opts ...Option) (*client.Rekor, error
o := makeOptions(opts...)

rt := httptransport.New(url.Host, client.DefaultBasePath, []string{url.Scheme})
rt.Consumers["application/yaml"] = YamlConsumer()
rt.Consumers["application/json"] = runtime.JSONConsumer()
rt.Consumers["application/x-pem-file"] = runtime.TextConsumer()
rt.Consumers["application/pem-certificate-chain"] = runtime.TextConsumer()
rt.Producers["application/yaml"] = YamlProducer()
rt.Producers["application/json"] = runtime.JSONProducer()
rt.Producers["application/timestamp-query"] = runtime.ByteStreamProducer()
rt.Consumers["application/timestamp-reply"] = runtime.ByteStreamConsumer()

Expand Down
46 changes: 0 additions & 46 deletions pkg/client/yaml.go

This file was deleted.

16 changes: 8 additions & 8 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.

4 changes: 2 additions & 2 deletions pkg/generated/client/index/index_client.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/pubkey/pubkey_client.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/server/server_client.go

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

8 changes: 4 additions & 4 deletions pkg/generated/client/tlog/tlog_client.go

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

4 changes: 0 additions & 4 deletions pkg/generated/restapi/configure_rekor_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import (
"github.com/spf13/viper"

pkgapi "github.com/sigstore/rekor/pkg/api"
"github.com/sigstore/rekor/pkg/client"
"github.com/sigstore/rekor/pkg/generated/restapi/operations"
"github.com/sigstore/rekor/pkg/generated/restapi/operations/entries"
"github.com/sigstore/rekor/pkg/generated/restapi/operations/index"
Expand Down Expand Up @@ -71,9 +70,6 @@ func configureAPI(api *operations.RekorServerAPI) http.Handler {
api.JSONConsumer = runtime.JSONConsumer()
api.JSONProducer = runtime.JSONProducer()

api.YamlConsumer = client.YamlConsumer()
api.YamlProducer = client.YamlProducer()

api.ApplicationXPemFileProducer = runtime.TextProducer()

api.EntriesCreateLogEntryHandler = entries.CreateLogEntryHandlerFunc(pkgapi.CreateLogEntryHandler)
Expand Down
2 changes: 0 additions & 2 deletions pkg/generated/restapi/doc.go

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

12 changes: 4 additions & 8 deletions pkg/generated/restapi/embedded_spec.go

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

19 changes: 0 additions & 19 deletions pkg/generated/restapi/operations/rekor_server_api.go

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

6 changes: 3 additions & 3 deletions pkg/sharding/ranges.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ type LogRanges struct {
type Ranges []LogRange

type LogRange struct {
TreeID int64 `yaml:"treeID"`
TreeLength int64 `yaml:"treeLength"`
EncodedPublicKey string `yaml:"encodedPublicKey"`
TreeID int64 `json:"treeID"`
TreeLength int64 `json:"treeLength"`
EncodedPublicKey string `json:"encodedPublicKey"`
decodedPublicKey string
}

Expand Down