diff --git a/.circleci/config.yml b/.circleci/config.yml index e804a1bfbd..1f44774018 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,7 +1,7 @@ version: 2.1 orbs: - sdk: ory/sdk@0.1.43 + sdk: ory/sdk@0.1.52 changelog: ory/changelog@0.1.10 goreleaser: ory/goreleaser@0.1.34 slack: circleci/slack@3.4.2 diff --git a/Dockerfile b/Dockerfile index f3995e69ec..50fed15dd5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ # To compile this image manually run: # # $ make docker -FROM alpine:3.14.2 +FROM alpine:3.15.0 RUN apk add -U --no-cache ca-certificates diff --git a/Dockerfile-alpine b/Dockerfile-alpine index c098a2d28d..aaeddc8d3b 100644 --- a/Dockerfile-alpine +++ b/Dockerfile-alpine @@ -1,7 +1,7 @@ # To compile this image manually run: # # $ make docker -FROM alpine:3.14.2 +FROM alpine:3.15.0 RUN addgroup -S ory; \ adduser -S ory -G ory -D -H -s /bin/nologin diff --git a/Makefile b/Makefile index b3093cf207..ccc1625cdc 100644 --- a/Makefile +++ b/Makefile @@ -39,7 +39,7 @@ gen: mocks sdk .bin/ory: Makefile - bash <(curl https://raw.githubusercontent.com/ory/cli/master/install.sh) -b .bin v0.0.53 + bash <(curl https://raw.githubusercontent.com/ory/meta/master/install.sh) -b .bin v0.0.53 touch -a -m .bin/ory # Generates the SDKs diff --git a/docs/scripts/config.js b/docs/scripts/config.js index 058a030e05..ce2bc434d8 100644 --- a/docs/scripts/config.js +++ b/docs/scripts/config.js @@ -45,98 +45,100 @@ if (process.argv.length !== 3 || process.argv[1] === 'help') { const config = require(path.resolve(process.argv[2])) -const enhance = (schema, parents = []) => (item) => { - const key = item.key.value - - const path = [ - ...parents.map((parent) => ['properties', parent]), - ['properties', key] - ].flat() - - if (['title', 'description'].find((f) => path[path.length - 1] === f)) { - return - } +const enhance = + (schema, parents = []) => + (item) => { + const key = item.key.value + + const path = [ + ...parents.map((parent) => ['properties', parent]), + ['properties', key] + ].flat() + + if (['title', 'description'].find((f) => path[path.length - 1] === f)) { + return + } - const comments = [`# ${pathOr(key, [...path, 'title'], schema)} ##`, ''] + const comments = [`# ${pathOr(key, [...path, 'title'], schema)} ##`, ''] - const description = pathOr('', [...path, 'description'], schema) - if (description) { - comments.push(' ' + description.split('\n').join('\n '), '') - } + const description = pathOr('', [...path, 'description'], schema) + if (description) { + comments.push(' ' + description.split('\n').join('\n '), '') + } - const defaultValue = pathOr('', [...path, 'default'], schema) - if (defaultValue || defaultValue === false) { - comments.push(' Default value: ' + defaultValue, '') - } + const defaultValue = pathOr('', [...path, 'default'], schema) + if (defaultValue || defaultValue === false) { + comments.push(' Default value: ' + defaultValue, '') + } - const enums = pathOr('', [...path, 'enum'], schema) - if (enums && Array.isArray(enums)) { - comments.push( - ' One of:', - ...YAML.stringify(enums) - .split('\n') - .map((i) => ` ${i}`) - ) // split always returns one empty object so no need for newline - } + const enums = pathOr('', [...path, 'enum'], schema) + if (enums && Array.isArray(enums)) { + comments.push( + ' One of:', + ...YAML.stringify(enums) + .split('\n') + .map((i) => ` ${i}`) + ) // split always returns one empty object so no need for newline + } - const min = pathOr('', [...path, 'minimum'], schema) - if (min || min === 0) { - comments.push(` Minimum value: ${min}`, '') - } + const min = pathOr('', [...path, 'minimum'], schema) + if (min || min === 0) { + comments.push(` Minimum value: ${min}`, '') + } - const max = pathOr('', [...path, 'maximum'], schema) - if (max || max === 0) { - comments.push(` Maximum value: ${max}`, '') - } + const max = pathOr('', [...path, 'maximum'], schema) + if (max || max === 0) { + comments.push(` Maximum value: ${max}`, '') + } - const examples = pathOr('', [...path, 'examples'], schema) - if (examples) { - comments.push( - ' Examples:', - ...YAML.stringify(examples) - .split('\n') - .map((i) => ` ${i}`) - ) // split always returns one empty object so no need for newline - } + const examples = pathOr('', [...path, 'examples'], schema) + if (examples) { + comments.push( + ' Examples:', + ...YAML.stringify(examples) + .split('\n') + .map((i) => ` ${i}`) + ) // split always returns one empty object so no need for newline + } - let hasChildren - if (item.value.items) { - item.value.items.forEach((item) => { - if (item.key) { - enhance(schema, [...parents, key])(item) - hasChildren = true - } - }) - } + let hasChildren + if (item.value.items) { + item.value.items.forEach((item) => { + if (item.key) { + enhance(schema, [...parents, key])(item) + hasChildren = true + } + }) + } - const showEnvVarBlockForObject = pathOr( - '', - [...path, 'showEnvVarBlockForObject'], - schema - ) - if (!hasChildren || showEnvVarBlockForObject) { - const env = [...parents, key].map((i) => i.toUpperCase()).join('_') - comments.push( - ' Set this value using environment variables on', - ' - Linux/macOS:', - ` $ export ${env}=`, - ' - Windows Command Line (CMD):', - ` > set ${env}=`, - '' + const showEnvVarBlockForObject = pathOr( + '', + [...path, 'showEnvVarBlockForObject'], + schema ) - - // Show this if the config property is an object, to call out how to specify the env var - if (hasChildren) { + if (!hasChildren || showEnvVarBlockForObject) { + const env = [...parents, key].map((i) => i.toUpperCase()).join('_') comments.push( - ' This can be set as an environment variable by supplying it as a JSON object.', + ' Set this value using environment variables on', + ' - Linux/macOS:', + ` $ export ${env}=`, + ' - Windows Command Line (CMD):', + ` > set ${env}=`, '' ) + + // Show this if the config property is an object, to call out how to specify the env var + if (hasChildren) { + comments.push( + ' This can be set as an environment variable by supplying it as a JSON object.', + '' + ) + } } - } - item.commentBefore = comments.join('\n') - item.spaceBefore = true -} + item.commentBefore = comments.join('\n') + item.spaceBefore = true + } new Promise((resolve, reject) => { parser.dereference( diff --git a/docs/src/theme/CodeFromRemote.js b/docs/src/theme/CodeFromRemote.js index a3609647f3..189028c209 100644 --- a/docs/src/theme/CodeFromRemote.js +++ b/docs/src/theme/CodeFromRemote.js @@ -53,21 +53,23 @@ const findLine = (needle, haystack) => { return index } -const transform = ({ startAt, endAt }) => (content) => { - let lines = content.split('\n') +const transform = + ({ startAt, endAt }) => + (content) => { + let lines = content.split('\n') - const startIndex = findLine(startAt, lines) - if (startIndex > 0) { - lines = ['// ...', ...lines.slice(startIndex, -1)] - } + const startIndex = findLine(startAt, lines) + if (startIndex > 0) { + lines = ['// ...', ...lines.slice(startIndex, -1)] + } - const endIndex = findLine(endAt, lines) - if (endIndex > 0) { - lines = [...lines.slice(0, endIndex + 1), '// ...'] - } + const endIndex = findLine(endAt, lines) + if (endIndex > 0) { + lines = [...lines.slice(0, endIndex + 1), '// ...'] + } - return lines.join('\n') -} + return lines.join('\n') + } const CodeFromRemote = (props) => { const { src, title } = props diff --git a/docs/src/theme/ketoRelationTuplesPrism.js b/docs/src/theme/ketoRelationTuplesPrism.js index 513d653dfd..9a00e5bbf7 100644 --- a/docs/src/theme/ketoRelationTuplesPrism.js +++ b/docs/src/theme/ketoRelationTuplesPrism.js @@ -44,7 +44,8 @@ export default (prism) => (prism.languages['keto-relation-tuples'] = { comment: /\/\/.*(\n|$)/, 'relation-tuple': { - pattern: /([^:#@()\n]+:)?([^:#@()\n]+)#([^:#@()\n]+)@?((\(([^:#@()\n]+:)?([^:#@()\n]+)#([^:#@()\n]*)\))|([^:#@()\n]+))/, + pattern: + /([^:#@()\n]+:)?([^:#@()\n]+)#([^:#@()\n]+)@?((\(([^:#@()\n]+:)?([^:#@()\n]+)#([^:#@()\n]*)\))|([^:#@()\n]+))/, inside: { namespace, object, diff --git a/go.mod b/go.mod index 5474ca29b0..fbfa2ee2ba 100644 --- a/go.mod +++ b/go.mod @@ -20,7 +20,7 @@ require ( github.com/form3tech-oss/jwt-go v3.2.2+incompatible github.com/fsnotify/fsnotify v1.4.9 github.com/ghodss/yaml v1.0.0 - github.com/go-openapi/errors v0.19.6 + github.com/go-openapi/errors v0.20.1 github.com/go-openapi/runtime v0.19.20 github.com/go-openapi/strfmt v0.19.5 github.com/go-openapi/swag v0.19.9 diff --git a/go.sum b/go.sum index e3ef29cda6..b23389c400 100644 --- a/go.sum +++ b/go.sum @@ -277,8 +277,9 @@ github.com/go-openapi/errors v0.17.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQH github.com/go-openapi/errors v0.18.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= github.com/go-openapi/errors v0.19.3/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= -github.com/go-openapi/errors v0.19.6 h1:xZMThgv5SQ7SMbWtKFkCf9bBdvR2iEyw9k3zGZONuys= github.com/go-openapi/errors v0.19.6/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= +github.com/go-openapi/errors v0.20.1 h1:j23mMDtRxMwIobkpId7sWh7Ddcx4ivaoqUbfXx5P+a8= +github.com/go-openapi/errors v0.20.1/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= github.com/go-openapi/inflect v0.19.0 h1:9jCH9scKIbHeV9m12SmPilScz6krDxKRasNNSNPXu/4= github.com/go-openapi/inflect v0.19.0/go.mod h1:lHpZVlpIQqLyKwJ4N+YSc9hchQy/i12fJykb83CRBH4= github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= diff --git a/pipeline/authn/authenticator_oauth2_introspection_cache_test.go b/pipeline/authn/authenticator_oauth2_introspection_cache_test.go index dd20f950ae..e9be52fcee 100644 --- a/pipeline/authn/authenticator_oauth2_introspection_cache_test.go +++ b/pipeline/authn/authenticator_oauth2_introspection_cache_test.go @@ -4,12 +4,13 @@ import ( "testing" "time" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/ory/fosite" "github.com/ory/oathkeeper/driver/configuration" "github.com/ory/viper" "github.com/ory/x/logrusx" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" ) func TestCache(t *testing.T) { diff --git a/test/reload/run.sh b/test/reload/run.sh index f560e2c0cc..2f2810c36d 100755 --- a/test/reload/run.sh +++ b/test/reload/run.sh @@ -34,7 +34,7 @@ waitport 6061 function finish { cat ./config.yaml - cat ./rules.3.json + cat ./rules.3.json || true cat ./oathkeeper.log } trap finish EXIT