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

Merge v0.0.614 to fandom_master #7

Open
wants to merge 57 commits into
base: fandom_master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
ffcc8bd
fix(otelx): forward all headers (#698)
davidspek Jun 22, 2023
0d30de8
fix(pagination): add table name to fields in keyset pagination (#699)
zepatrik Jun 26, 2023
1c62a8a
feat: allow Go migrations outside of an SQL transaction (#696)
alnr Jun 26, 2023
126d8c9
chore(deps): update go-jose (#700)
hperl Jun 29, 2023
d358437
chore(deps): update go-jose (#701)
hperl Jun 29, 2023
6314ad0
chore(deps): bump google.golang.org/grpc from 1.50.1 to 1.53.0 (#702)
dependabot[bot] Jul 7, 2023
adf235e
fix: remove up-to-step event (#703)
aeneasr Jul 17, 2023
4c979b6
fix: use incoming TLS to detect originalScheme (#705)
aeneasr Jul 18, 2023
3b15b7c
feat: support override for originalScheme (#704)
aeneasr Jul 18, 2023
e77f73f
feat(proxy): flag to keep forwarded headers (#706)
aeneasr Jul 18, 2023
d50f3ce
feat(clidoc): enable templating for command fields (#707)
zepatrik Jul 26, 2023
d3779fe
feat: add breaking test for fsx.Merge
alnr Aug 2, 2023
9f09e61
fix(fsx): multiple merges edge cases
zepatrik Aug 2, 2023
19829a9
feat: add more tests to fsx
alnr Aug 3, 2023
21b1639
feat: add `Authorization` header to OTEL config (CORE-2291) (#708)
splaunov Aug 3, 2023
e9342cd
chore: update repository templates to https://github.com/ory/meta/com…
aeneasr Aug 3, 2023
4a2efe9
chore: update repository templates to https://github.com/ory/meta/com…
aeneasr Aug 7, 2023
17527e9
feat: allow exceptions in immutables & CORS hot-reload (#713)
zepatrik Aug 10, 2023
7e34b16
feat: add jwtmiddleware for oathkeeper JWTs (#715)
aeneasr Aug 10, 2023
b50b315
fix(pagination): quote function broken for mysql (#716)
zepatrik Aug 11, 2023
a20fd1e
docs(pagination): improve parameter descriptions (#712)
zepatrik Aug 11, 2023
3ec4565
feat: match exception URLs via globbing (#717)
hperl Aug 16, 2023
460bc74
chore(jsonnetsecure): add tracing (#718)
zepatrik Aug 18, 2023
b0b6aa7
feat: add `deployment.environment` attribute to OTEL data (CORE-2294)…
splaunov Aug 22, 2023
577e4fb
feat: add DirtyPatch method (#719)
aeneasr Aug 25, 2023
5ebc1cb
feat: add jwks fetcher (#720)
aeneasr Sep 4, 2023
d1b24d4
fix: add missing pagination parameters to migrationpagination package…
aeneasr Sep 6, 2023
fbf9d35
feat: add token pagination link header parser (#722)
aeneasr Sep 6, 2023
78da4d7
feat: add geolocation to trace events (#724)
alnr Sep 14, 2023
45f6c90
feat: force clientFoundRows to true (#727)
aeneasr Oct 6, 2023
67f2a27
fix: link header in keyset pagination (#729)
alnr Oct 10, 2023
4d5bf8d
feat: add crdb consistency guarantees (#728)
aeneasr Oct 11, 2023
53c3843
docs: update docstring for consistency
aeneasr Oct 11, 2023
4126131
fix: correctly return unset for consistency (#732)
aeneasr Oct 11, 2023
0e34bc4
feat: add a read only transaction helper (#734)
aeneasr Oct 12, 2023
e6c61ed
feat(otelx): add workspace attribute (#735)
zepatrik Oct 12, 2023
771b19c
feat: add custom JWK parse error type (#739)
nipsufn Oct 26, 2023
acad8b0
feat: add batch insert (#744)
aeneasr Nov 7, 2023
33c73f3
fix: decoderx dropped errors (#741)
alrs Nov 10, 2023
e1d7bd3
feat: improve batch create API (#745)
aeneasr Nov 10, 2023
9909a38
feat: add WithMaxHTTPMaxBytes option to fetcher to limit HTTP respons…
alnr Oct 11, 2023
b054e33
chore(deps): bump google.golang.org/grpc from 1.53.0 to 1.56.3 (#738)
dependabot[bot] Nov 15, 2023
5ad9c46
chore(deps): bump golang.org/x/image from 0.5.0 to 0.10.0 (#743)
dependabot[bot] Nov 15, 2023
022d9bd
feat: improved SSRF protection
alnr Nov 13, 2023
5616e97
feat: Add Vowels & NoVowels to the AlphaUpper charsets (#749)
supercairos Nov 29, 2023
bb9fbed
chore(deps): bump github.com/go-jose/go-jose/v3 from 3.0.0 to 3.0.1
dependabot[bot] Dec 14, 2023
0910275
feat: update otel (#751)
aeneasr Dec 28, 2023
e77628a
chore: update otel
aeneasr Dec 28, 2023
1c6366e
fix: consider only non-empty values when parsing pagination parameter…
alnr Jan 4, 2024
728f15d
fix: bump licence formatter to not update all the copyright years
alnr Jan 4, 2024
83b6be2
feat: add caching option to fetcher (#753)
alnr Jan 19, 2024
135889c
feat: pooled process-isolated Jsonnet VM
alnr Jan 22, 2024
ee6571a
fix: update snapshots
alnr Jan 23, 2024
0cdec1a
feat: add nullable bool defaulting to false (#758)
aeneasr Jan 30, 2024
a6f7cce
fix: revert fetcher API for backwards-compatibility (#760)
alnr Feb 2, 2024
041443c
feat: add http client option to disable IPv6
alnr Feb 5, 2024
87531a5
merge
adpaste Mar 8, 2024
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
10 changes: 8 additions & 2 deletions .github/ISSUE_TEMPLATE/BUG-REPORT.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,21 @@ body:
"I have read and am following this repository's [Contribution
Guidelines](https://github.com/ory/x/blob/master/CONTRIBUTING.md)."
required: true
- label:
"This issue affects my [Ory Network](https://www.ory.sh/) project."
- label:
"I have joined the [Ory Community Slack](https://slack.ory.sh)."
- label:
"I am signed up to the [Ory Security Patch
Newsletter](https://ory.us10.list-manage.com/subscribe?u=ffb1a878e4ec6c0ed312a3480&id=f605a41b53)."
id: checklist
type: checkboxes
- attributes:
description:
"Enter the slug or API URL of the affected Ory Network project. Leave
empty when you are self-hosting."
label: "Ory Network Project"
placeholder: "https://<your-project-slug>.projects.oryapis.com"
id: ory-network-project
type: input
- attributes:
description: "A clear and concise description of what the bug is."
label: "Describe the bug"
Expand Down
10 changes: 8 additions & 2 deletions .github/ISSUE_TEMPLATE/DESIGN-DOC.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,21 @@ body:
"I have read and am following this repository's [Contribution
Guidelines](https://github.com/ory/x/blob/master/CONTRIBUTING.md)."
required: true
- label:
"This issue affects my [Ory Network](https://www.ory.sh/) project."
- label:
"I have joined the [Ory Community Slack](https://slack.ory.sh)."
- label:
"I am signed up to the [Ory Security Patch
Newsletter](https://ory.us10.list-manage.com/subscribe?u=ffb1a878e4ec6c0ed312a3480&id=f605a41b53)."
id: checklist
type: checkboxes
- attributes:
description:
"Enter the slug or API URL of the affected Ory Network project. Leave
empty when you are self-hosting."
label: "Ory Network Project"
placeholder: "https://<your-project-slug>.projects.oryapis.com"
id: ory-network-project
type: input
- attributes:
description: |
This section gives the reader a very rough overview of the landscape in which the new system is being built and what is actually being built. This isn’t a requirements doc. Keep it succinct! The goal is that readers are brought up to speed but some previous knowledge can be assumed and detailed info can be linked to. This section should be entirely focused on objective background facts.
Expand Down
10 changes: 8 additions & 2 deletions .github/ISSUE_TEMPLATE/FEATURE-REQUEST.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,21 @@ body:
"I have read and am following this repository's [Contribution
Guidelines](https://github.com/ory/x/blob/master/CONTRIBUTING.md)."
required: true
- label:
"This issue affects my [Ory Network](https://www.ory.sh/) project."
- label:
"I have joined the [Ory Community Slack](https://slack.ory.sh)."
- label:
"I am signed up to the [Ory Security Patch
Newsletter](https://ory.us10.list-manage.com/subscribe?u=ffb1a878e4ec6c0ed312a3480&id=f605a41b53)."
id: checklist
type: checkboxes
- attributes:
description:
"Enter the slug or API URL of the affected Ory Network project. Leave
empty when you are self-hosting."
label: "Ory Network Project"
placeholder: "https://<your-project-slug>.projects.oryapis.com"
id: ory-network-project
type: input
- attributes:
description:
"Is your feature request related to a problem? Please describe."
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: "1.20"
go-version: "1.21"
- run: make format
- name: Indicate formatting issues
run: git diff HEAD --exit-code --color
2 changes: 1 addition & 1 deletion .github/workflows/licenses.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: "1.20"
go-version: "1.21"
- uses: actions/setup-node@v2
with:
node-version: "18"
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: "1.20"
go-version: "1.21"
- run: |
go test -tags sqlite -failfast -short -timeout=20m $(go list ./... | grep -v sqlcon | grep -v watcherx | grep -v pkgerx | grep -v configx)
shell: bash
Expand Down Expand Up @@ -55,12 +55,13 @@ jobs:
uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: "1.20"
go-version: "1.21"
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.55.2
skip-go-installation: true
args: --timeout 2m
args: --timeout 5m
- name: Install cockroach DB
run: |
curl https://binaries.cockroachdb.com/cockroach-v22.2.5.linux-amd64.tgz | tar -xz
Expand Down
10 changes: 10 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,16 @@ Examples of unacceptable behavior include:
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Open Source Community Support

Ory Open source software is collaborative and based on contributions by
developers in the Ory community. There is no obligation from Ory to help with
individual problems. If Ory open source software is used in production in a
for-profit company or enterprise environment, we mandate a paid support contract
where Ory is obligated under their service level agreements (SLAs) to offer a
defined level of availability and responsibility. For more information about
paid support please contact us at [email protected].

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ $(foreach dep, $(GO_DEPENDENCIES), $(eval $(call make-go-dependency, $(dep))))
$(call make-lint-dependency)

.bin/ory: Makefile
curl https://raw.githubusercontent.com/ory/meta/master/install.sh | bash -s -- -b .bin ory v0.1.48
curl https://raw.githubusercontent.com/ory/meta/master/install.sh | bash -s -- -b .bin ory v0.2.2
touch .bin/ory

.PHONY: format
Expand All @@ -32,7 +32,7 @@ licenses: .bin/licenses node_modules # checks open-source licenses
GOBIN=$(shell pwd)/.bin go install golang.org/x/tools/cmd/goimports@latest

.bin/golangci-lint: Makefile
bash <(curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh) -d -b .bin v1.46.2
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b .bin v1.55.2

.bin/licenses: Makefile
curl https://raw.githubusercontent.com/ory/ci/master/licenses/install | sh
Expand All @@ -56,7 +56,7 @@ resetdb:

.PHONY: lint
lint: .bin/golangci-lint
GO111MODULE=on golangci-lint run -v ./...
GO111MODULE=on .bin/golangci-lint run -v ./...

.PHONY: migrations-render
migrations-render: .bin/ory
Expand Down
2 changes: 1 addition & 1 deletion clidoc/generate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ root
child1

<[some argument]>
`}
`, Example: "{{ .CommandPath }} --whatever"}
child2 = &cobra.Command{Use: "child2", Run: noopRun, Long: `A sample text
child2

Expand Down
16 changes: 14 additions & 2 deletions clidoc/md_docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import (
"sort"
"strings"

"github.com/ory/x/cmdx"

"github.com/spf13/cobra"
)

Expand Down Expand Up @@ -62,7 +64,12 @@ func GenMarkdownCustom(cmd *cobra.Command, w io.Writer, linkHandler func(string)
buf.WriteString(cmd.Short + "\n\n")
if len(cmd.Long) > 0 {
buf.WriteString("### Synopsis\n\n")
buf.WriteString(cmd.Long + "\n\n")
long, err := cmdx.TemplateCommandField(cmd, cmd.Long)
if err != nil {
buf.WriteString(fmt.Sprintf("<!-- Error rendering cmd.Long: %s -->\n\n", err.Error()))
long = cmd.Long
}
buf.WriteString(long + "\n\n")
}

if cmd.Runnable() {
Expand All @@ -71,7 +78,12 @@ func GenMarkdownCustom(cmd *cobra.Command, w io.Writer, linkHandler func(string)

if len(cmd.Example) > 0 {
buf.WriteString("### Examples\n\n")
buf.WriteString(fmt.Sprintf("```\n%s\n```\n\n", cmd.Example))
example, err := cmdx.TemplateCommandField(cmd, cmd.Example)
if err != nil {
buf.WriteString(fmt.Sprintf("<!-- Error rendering cmd.Example: %s -->\n\n", err.Error()))
example = cmd.Example
}
buf.WriteString(fmt.Sprintf("```\n%s\n```\n\n", example))
}

if err := printOptions(buf, cmd, name); err != nil {
Expand Down
6 changes: 6 additions & 0 deletions clidoc/testdata/root-child1.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ child1
root child1 [flags]
```

### Examples

```
root child1 --whatever
```

### Options

```
Expand Down
28 changes: 15 additions & 13 deletions cmdx/usage.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,25 +54,27 @@ Use "{{.CommandPath}} [command] --help" for more information about a command.{{e
// The data for the template is the command itself. Especially useful are `.Root.Name` and `.CommandPath`.
// This will be inherited by all subcommands, so enabling it on the root command is sufficient.
func EnableUsageTemplating(cmds ...*cobra.Command) {
cobra.AddTemplateFunc("insertTemplate", func(cmd *cobra.Command, tmpl string) (string, error) {
t := template.New("")
t.Funcs(usageTemplateFuncs)
t, err := t.Parse(tmpl)
if err != nil {
return "", err
}
var out bytes.Buffer
if err := t.Execute(&out, cmd); err != nil {
return "", err
}
return out.String(), nil
})
cobra.AddTemplateFunc("insertTemplate", TemplateCommandField)
for _, cmd := range cmds {
cmd.SetHelpTemplate(helpTemplate)
cmd.SetUsageTemplate(usageTemplate)
}
}

func TemplateCommandField(cmd *cobra.Command, field string) (string, error) {
t := template.New("")
t.Funcs(usageTemplateFuncs)
t, err := t.Parse(field)
if err != nil {
return "", err
}
var out bytes.Buffer
if err := t.Execute(&out, cmd); err != nil {
return "", err
}
return out.String(), nil
}

// DisableUsageTemplating resets the commands usage template to the default.
// This can be used to undo the effects of EnableUsageTemplating, specifically for a subcommand.
func DisableUsageTemplating(cmds ...*cobra.Command) {
Expand Down
6 changes: 6 additions & 0 deletions configx/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ func WithImmutables(immutables ...string) OptionModifier {
}
}

func WithExceptImmutables(exceptImmutables ...string) OptionModifier {
return func(p *Provider) {
p.exceptImmutables = append(p.exceptImmutables, exceptImmutables...)
}
}

func WithFlags(flags *pflag.FlagSet) OptionModifier {
return func(p *Provider) {
p.flags = flags
Expand Down
65 changes: 58 additions & 7 deletions configx/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ type tuple struct {
type Provider struct {
l sync.RWMutex
*koanf.Koanf
immutables []string
immutables, exceptImmutables []string

schema []byte
flags *pflag.FlagSet
Expand Down Expand Up @@ -249,6 +249,18 @@ func (p *Provider) runOnChanges(e watcherx.Event, err error) {
}
}

func deleteOtherKeys(k *koanf.Koanf, keys []string) {
outer:
for _, key := range k.Keys() {
for _, ik := range keys {
if key == ik {
continue outer
}
}
k.Delete(key)
}
}

func (p *Provider) reload(e watcherx.Event) {
p.l.Lock()

Expand All @@ -264,10 +276,20 @@ func (p *Provider) reload(e watcherx.Event) {
return // unlocks & runs changes in defer
}

for _, key := range p.immutables {
if !reflect.DeepEqual(p.Koanf.Get(key), nk.Get(key)) {
err = NewImmutableError(key, fmt.Sprintf("%v", p.Koanf.Get(key)), fmt.Sprintf("%v", nk.Get(key)))
return // unlocks & runs changes in defer
oldImmutables, newImmutables := p.Koanf.Copy(), nk.Copy()
deleteOtherKeys(oldImmutables, p.immutables)
deleteOtherKeys(newImmutables, p.immutables)

for _, key := range p.exceptImmutables {
oldImmutables.Delete(key)
newImmutables.Delete(key)
}
if !reflect.DeepEqual(oldImmutables.Raw(), newImmutables.Raw()) {
for _, key := range p.immutables {
if !reflect.DeepEqual(oldImmutables.Get(key), newImmutables.Get(key)) {
err = NewImmutableError(key, fmt.Sprintf("%v", p.Koanf.Get(key)), fmt.Sprintf("%v", nk.Get(key)))
return // unlocks & runs changes in defer
}
}
}

Expand All @@ -292,6 +314,33 @@ func (p *Provider) watchForFileChanges(ctx context.Context, c watcherx.EventChan
}
}

// DirtyPatch patches individual config keys without reloading the full config
//
// WARNING! This method is only useful to override existing keys in string or number
// format. DO NOT use this method to override arrays, maps, or other complex types.
//
// This method DOES NOT validate the config against the config JSON schema. If you
// need to validate the config, use the Set method instead.
//
// This method can not be used to remove keys from the config as that is not
// possible without reloading the full config.
func (p *Provider) DirtyPatch(key string, value any) error {
p.l.Lock()
defer p.l.Unlock()

t := tuple{Key: key, Value: value}
kc := NewKoanfConfmap([]tuple{t})

p.forcedValues = append(p.forcedValues, t)
p.providers = append(p.providers, kc)

if err := p.Koanf.Load(kc, nil, []koanf.Option{}...); err != nil {
return err
}

return nil
}

func (p *Provider) Set(key string, value interface{}) error {
p.l.Lock()
defer p.l.Unlock()
Expand Down Expand Up @@ -432,8 +481,9 @@ func (p *Provider) CORS(prefix string, defaults cors.Options) (cors.Options, boo

func (p *Provider) TracingConfig(serviceName string) *otelx.Config {
return &otelx.Config{
ServiceName: p.StringF("tracing.service_name", serviceName),
Provider: p.String("tracing.provider"),
ServiceName: p.StringF("tracing.service_name", serviceName),
DeploymentEnvironment: p.StringF("tracing.deployment_environment", ""),
Provider: p.String("tracing.provider"),
Providers: otelx.ProvidersConfig{
Jaeger: otelx.JaegerConfig{
Sampling: otelx.JaegerSampling{
Expand All @@ -454,6 +504,7 @@ func (p *Provider) TracingConfig(serviceName string) *otelx.Config {
Sampling: otelx.OTLPSampling{
SamplingRatio: p.Float64("tracing.providers.otlp.sampling.sampling_ratio"),
},
AuthorizationHeader: p.String("tracing.providers.otlp.authorization_header"),
},
},
}
Expand Down
Loading
Loading