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

use johakoch's go-cty and hcl forks (as an example) #816

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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 config/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type API struct {
DisableAccessControl []string `hcl:"disable_access_control,optional" docs:"Disables access controls by name."`
Endpoints Endpoints `hcl:"endpoint,block" docs:"Configures an [endpoint](/configuration/block/endpoint) (zero or more)."`
ErrorFile string `hcl:"error_file,optional" docs:"Location of the error file template."`
Name string `hcl:"name,label,optional"`
Name string `hcl:"name,label_optional"`
Remain hcl.Body `hcl:",remain"`

// internally used
Expand Down
2 changes: 1 addition & 1 deletion config/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type Backend struct {
Health *Health `hcl:"beta_health,block" docs:"Configures a [health check](/configuration/block/health) (zero or one)."`
HTTP2 bool `hcl:"http2,optional" docs:"Enables the HTTP2 support. Must not be used in backend refinement."`
MaxConnections int `hcl:"max_connections,optional" docs:"The maximum number of concurrent connections in any state (_active_ or _idle_) to the origin. Must not be used in backend refinement." default:"0"`
Name string `hcl:"name,label,optional"`
Name string `hcl:"name,label_optional"`
OpenAPI *OpenAPI `hcl:"openapi,block" docs:"Configures [OpenAPI validation](/configuration/block/openapi) (zero or one)."`
RateLimits RateLimits `hcl:"beta_rate_limit,block" docs:"Configures [rate limiting](/configuration/block/rate_limit) (zero or one)."`
Remain hcl.Body `hcl:",remain"`
Expand Down
4 changes: 2 additions & 2 deletions config/certificate.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package config

type ClientCertificate struct {
Name string `hcl:",label,optional"`
Name string `hcl:",label_optional"`
CA string `hcl:"ca_certificate,optional" docs:"Public part of the certificate authority in DER or PEM format. Mutually exclusive with {ca_certificate_file}."`
CAFile string `hcl:"ca_certificate_file,optional" docs:"Reference to a file containing the public part of the certificate authority file in DER or PEM format. Mutually exclusive with {ca_certificate}."`
Leaf string `hcl:"leaf_certificate,optional" docs:"Public part of the client certificate in DER or PEM format. Mutually exclusive with {leaf_certificate_file}."`
LeafFile string `hcl:"leaf_certificate_file,optional" docs:"Reference to a file containing the public part of the client certificate file in DER or PEM format. Mutually exclusive with {leaf_certificate}."`
}

type ServerCertificate struct {
Name string `hcl:",label,optional"`
Name string `hcl:",label_optional"`
PublicKey string `hcl:"public_key,optional" docs:"Public part of the certificate in DER or PEM format. Mutually exclusive with {public_key_file}."`
PublicKeyFile string `hcl:"public_key_file,optional" docs:"Reference to a file containing the public part of the certificate file in DER or PEM format. Mutually exclusive with {public_key}."`
PrivateKey string `hcl:"private_key,optional" docs:"Private part of the certificate in DER or PEM format. Mutually exclusive with {private_key_file}."`
Expand Down
2 changes: 1 addition & 1 deletion config/files.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type Files struct {
DisableAccessControl []string `hcl:"disable_access_control,optional"`
DocumentRoot string `hcl:"document_root" docs:"Location of the document root (directory)."`
ErrorFile string `hcl:"error_file,optional" docs:"Location of the error file template."`
Name string `hcl:"name,label,optional"`
Name string `hcl:"name,label_optional"`
Remain hcl.Body `hcl:",remain"`
}

Expand Down
2 changes: 1 addition & 1 deletion config/jwt_signing_profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ type JWTSigningProfile struct {
Headers hcl.Expression `hcl:"headers,optional" docs:"Additional HTTP header fields for the JWT, {typ} has the default value {JWT}, {alg} cannot be set."`
Key string `hcl:"key,optional" docs:"Private key (in PEM format) for {RS*} and {ES*} variants or the secret for {HS*} algorithms. Mutually exclusive with {key_file}."`
KeyFile string `hcl:"key_file,optional" docs:"Reference to file containing signing key. Mutually exclusive with {key}. See {key} for more information."`
Name string `hcl:"name,label,optional"`
Name string `hcl:"name,label_optional"`
SignatureAlgorithm string `hcl:"signature_algorithm" docs:"Algorithm used for signing: {\"RS256\"}, {\"RS384\"}, {\"RS512\"}, {\"HS256\"}, {\"HS384\"}, {\"HS512\"}, {\"ES256\"}, {\"ES384\"}, {\"ES512\"}."`
TTL string `hcl:"ttl" docs:"The token's time-to-live, creates the {exp} claim."`
}
2 changes: 1 addition & 1 deletion config/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var (
// Proxy represents the <Proxy> object.
type Proxy struct {
BackendName string `hcl:"backend,optional" docs:"References a [backend](/configuration/block/backend) in [definitions](/configuration/block/definitions) for the proxy request. Mutually exclusive with {backend} block."`
Name string `hcl:"name,label,optional"`
Name string `hcl:"name,label_optional"`
Remain hcl.Body `hcl:",remain"`
ReqName string `hcl:"name,optional" docs:"Defines the proxy request name. Allowed only in the [{definitions} block](definitions)." default:"default"`
Websockets *bool `hcl:"websockets,optional" docs:"Allows support for WebSockets. This attribute is only allowed in the \"default\" proxy block. Other {proxy} blocks, {request} blocks or {response} blocks are not allowed within the current {endpoint} block. Mutually exclusive with {websockets} block."`
Expand Down
2 changes: 1 addition & 1 deletion config/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ var (
// Request represents the <Request> object.
type Request struct {
BackendName string `hcl:"backend,optional" docs:"References a [backend](/configuration/block/backend) in [definitions](/configuration/block/definitions) for the request. Mutually exclusive with {backend} block."`
Name string `hcl:"name,label,optional"`
Name string `hcl:"name,label_optional"`
Remain hcl.Body `hcl:",remain"`

// Internally used
Expand Down
2 changes: 1 addition & 1 deletion config/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type Server struct {
ErrorFile string `hcl:"error_file,optional" docs:"Location of the error file template."`
Files FilesBlocks `hcl:"files,block" docs:"Configures file serving (zero or more)."`
Hosts []string `hcl:"hosts,optional" docs:"Mandatory, if there is more than one {server} block."`
Name string `hcl:"name,label,optional"`
Name string `hcl:"name,label_optional"`
Remain hcl.Body `hcl:",remain"`
SPAs SPAs `hcl:"spa,block" docs:"Configures an SPA (zero or more)."`
TLS *ServerTLS `hcl:"tls,block" docs:"Configures [server TLS](/configuration/block/server_tls) (zero or one)."`
Expand Down
2 changes: 1 addition & 1 deletion config/spa.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ type Spa struct {
BootstrapFile string `hcl:"bootstrap_file" docs:"Location of the bootstrap file."`
CORS *CORS `hcl:"cors,block" docs:"Configures [CORS](/configuration/block/cors) settings (zero or one)."`
DisableAccessControl []string `hcl:"disable_access_control,optional" docs:"Disables access controls by name."`
Name string `hcl:"name,label,optional"`
Name string `hcl:"name,label_optional"`
Paths []string `hcl:"paths" docs:"List of SPA paths that need the bootstrap file."`
Remain hcl.Body `hcl:",remain"`
}
Expand Down
2 changes: 1 addition & 1 deletion config/token_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ var TokenRequestBlockSchema = &hcl.BodySchema{

type TokenRequest struct {
BackendName string `hcl:"backend,optional" docs:"References a [backend](/configuration/block/backend) in [definitions](/configuration/block/definitions) for the token request. Mutually exclusive with {backend} block."`
Name string `hcl:"name,label,optional"`
Name string `hcl:"name,label_optional"`
URL string `hcl:"url,optional" docs:"URL of the resource to request the token from. May be relative to an origin specified in a referenced or nested {backend} block."`
Remain hcl.Body `hcl:",remain"`

Expand Down
12 changes: 7 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ require (
github.com/docker/go-units v0.5.0
github.com/fatih/color v1.13.0
github.com/getkin/kin-openapi v0.110.0
github.com/hashicorp/hcl/v2 v2.12.0
github.com/hashicorp/hcl/v2 v2.20.0
github.com/jimlambrt/go-oauth-pkce-code-verifier v0.0.0-20201220003123-6363600dffda
github.com/prometheus/client_golang v1.17.0
github.com/prometheus/client_model v0.5.0
github.com/rs/xid v1.4.0
github.com/russellhaering/gosaml2 v0.9.0
github.com/russellhaering/goxmldsig v1.2.0
github.com/sirupsen/logrus v1.9.0
github.com/zclconf/go-cty v1.12.1
github.com/zclconf/go-cty v1.14.4
go.opentelemetry.io/otel v1.21.0
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.44.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0
Expand All @@ -39,7 +39,7 @@ require (

require (
github.com/agext/levenshtein v1.2.3 // indirect
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect
github.com/beevik/etree v1.1.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
Expand All @@ -64,14 +64,16 @@ require (
github.com/prometheus/procfs v0.11.1 // indirect
github.com/sergi/go-diff v1.2.0 // indirect
go.opentelemetry.io/proto/otlp v1.0.0 // indirect
golang.org/x/mod v0.8.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.6.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

replace github.com/hashicorp/hcl/v2 v2.12.0 => github.com/coupergateway/hcl v1.0.1-0.20230906142022-13cdbca9a19f
replace github.com/hashicorp/hcl/v2 v2.20.0 => github.com/johakoch/hcl/v2 v2.0.0-20240321104555-6066cf57fe8f

replace github.com/zclconf/go-cty => github.com/coupergateway/go-cty v0.0.0-20220627115852-3ddf0a688aea
replace github.com/zclconf/go-cty v1.14.4 => github.com/johakoch/go-cty v0.0.0-20240321100345-e5b2277ac4dc
Loading
Loading