Skip to content
Open
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
10 changes: 10 additions & 0 deletions docs/self-hosted/oel/keto/configuration.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
id: configuration
title: OEL Configuration
---

```mdx-code-block
import ConfigMarkdown from '@site/src/components/ConfigMarkdown';

<ConfigMarkdown src="https://raw.githubusercontent.com/ory/keto/refs/heads/master/embedx/config.schema.json" binary="keto" />
```
10 changes: 10 additions & 0 deletions docs/self-hosted/oel/kratos/configuration.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
id: configuration
title: OEL Configuration
---

```mdx-code-block
import ConfigMarkdown from '@site/src/components/ConfigMarkdown';

<ConfigMarkdown src="https://raw.githubusercontent.com/ory/kratos/refs/heads/master/embedx/config.schema.json" binary="kratos" />
```
10 changes: 10 additions & 0 deletions docs/self-hosted/oel/oathkeeper/configuration.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
id: configuration
title: OEL Configuration
---

```mdx-code-block
import ConfigMarkdown from '@site/src/components/ConfigMarkdown';

<ConfigMarkdown src="https://raw.githubusercontent.com/ory/oathkeeper/refs/heads/master/spec/config.schema.json" binary="oathkeeper" />
```
10 changes: 10 additions & 0 deletions docs/self-hosted/oel/oauth2/configuration.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
id: configuration
title: OEL Configuration
---

```mdx-code-block
import ConfigMarkdown from '@site/src/components/ConfigMarkdown';

<ConfigMarkdown src="https://raw.githubusercontent.com/ory/hydra/refs/heads/master/spec/config.json" binary="hydra" />
```
17 changes: 8 additions & 9 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
]
},
"dependencies": {
"@apidevtools/json-schema-ref-parser": "11.7.3",
"@apidevtools/json-schema-ref-parser": "14.2.0",
"@docusaurus/core": "3.8.0",
"@docusaurus/plugin-client-redirects": "3.8.0",
"@docusaurus/plugin-content-docs": "3.8.0",
Expand Down
38 changes: 37 additions & 1 deletion src/components/ConfigMarkdown/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ const parser = new RefParser()
const refs = {
"ory://tracing-config": `https://raw.githubusercontent.com/ory/x/master/otelx/config.schema.json`,
"ory://logging-config": `https://raw.githubusercontent.com/ory/x/master/logrusx/config.schema.json`,
"ory://serve-config": `https://raw.githubusercontent.com/ory/x/master/configx/serve.schema.json`,
"ory://cors-config": `https://raw.githubusercontent.com/ory/x/master/configx/cors.schema.json`,
"ory://tls-config": `https://raw.githubusercontent.com/ory/x/master/configx/tls.schema.json`,
}

const enhance =
Expand Down Expand Up @@ -113,7 +116,36 @@ const enhance =
export const oryResolver = {
order: 1,
canRead: /^ory:/i,
read: ({ url }) => axios.get(refs[url]).then(({ data }) => data),
read: ({ url }) =>
axios.get(refs[url]).then(({ data }) => {
// Manually resolve internal $refs for schemas that have this issue
const resolveInternalRefs = (obj, definitions) => {
if (typeof obj === "object" && obj !== null) {
for (const key in obj) {
if (
key === "$ref" &&
typeof obj[key] === "string" &&
obj[key].startsWith("#/definitions/")
) {
const defName = obj[key].replace("#/definitions/", "")
if (definitions && definitions[defName]) {
// Replace the $ref with the actual definition
delete obj["$ref"]
Object.assign(obj, definitions[defName])
}
} else if (typeof obj[key] === "object") {
resolveInternalRefs(obj[key], definitions)
}
}
}
}

if (data.definitions) {
resolveInternalRefs(data, data.definitions)
}

return data
}),
}

export default function ConfigMarkdown(props: { src: string; binary: string }) {
Expand All @@ -132,6 +164,10 @@ export default function ConfigMarkdown(props: { src: string; binary: string }) {
.then((r) => r.json())
.then((schema) => {
new Promise((resolve, reject) => {
if (schema.title === "ORY Oathkeeper Configuration") {
schema["$id"] =
"https://github.com/ory/oathkeeper/schema/config.schema.json"
}
parser.dereference(
schema,
{
Expand Down
8 changes: 8 additions & 0 deletions src/sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1192,6 +1192,7 @@ const oel: SidebarItemsConfig = [
"self-hosted/oel/oauth2/token-prefix",
"self-hosted/oel/oauth2/migrate-postgresql-ttl",
"self-hosted/oel/oauth2/revert-database-migrations",
"self-hosted/oel/oauth2/configuration",
],
},
{
Expand All @@ -1200,6 +1201,7 @@ const oel: SidebarItemsConfig = [
items: [
"self-hosted/oel/oathkeeper/upgrade-oathkeeper",
"self-hosted/oel/oathkeeper/changelog",
"self-hosted/oel/oathkeeper/configuration",
],
},
{
Expand All @@ -1208,8 +1210,14 @@ const oel: SidebarItemsConfig = [
items: [
"self-hosted/oel/kratos/upgrade",
"self-hosted/oel/kratos/changelog",
"self-hosted/oel/kratos/configuration",
],
},
{
type: "category",
label: "Ory Keto Permissions",
items: ["self-hosted/oel/keto/configuration"],
},
{
type: "category",
label: "Ory Polis",
Expand Down
Loading