Skip to content

Commit dcdb845

Browse files
Kevin Goslaraeneasr
Kevin Goslar
authored andcommitted
Extract Prettier config into prettierrc (ory#160)
1 parent 02b33f9 commit dcdb845

File tree

8 files changed

+69
-60
lines changed

8 files changed

+69
-60
lines changed

.prettierrc

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"proseWrap": "always",
3+
"singleQuote": true,
4+
"trailingComma": "es5"
5+
}

docs/ecosystem/cloud-native.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ All ORY technology is built cloud native and follows
88

99
## 12 Factor Concepts
1010

11-
The following is a collection of core concepts to ORY's technological philosophy.
12-
They are summaries of the [12factor principles](https://www.12factor.net)
13-
written by Adam Wiggins.
11+
The following is a collection of core concepts to ORY's technological
12+
philosophy. They are summaries of the
13+
[12factor principles](https://www.12factor.net) written by Adam Wiggins.
1414

1515
### Codebase: One codebase tracked in revision control, many deploys
1616

docs/ecosystem/versioning.md

+15-15
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,21 @@ service versions and what they mean.
1616

1717
There are three maturity levels for services:
1818

19-
- **Graduated services** are mature, stable implementations of proven concepts.
20-
They rarely change in backwards incompatible ways. A
21-
service is considered graduated if the major version is >= 1, e.g. `v1.0.1`, `v2.2.2`.
22-
Backwards incompatible changes are indicated by a bump of the major version number.
23-
Most, if not all, REST APIs will provide
24-
backwards compatible transformations that make it possible to interact with
25-
the server using older API versions.
26-
- **Incubating services** implement well defined but not fully matured concepts.
27-
Incubating services have a major
28-
version number of `0`, e.g. `v0.10.0`. They have a higher (but overall moderate) probability for
29-
larger changes that can break backwards compatibility, for which there are upgrade guides.
30-
- **Sandbox services** implement concepts, APIs and CLIs at the experimental stage and can change in
31-
unpredictable ways. These services have a major version number of
32-
`0` and the `sandbox` label, e.g. `v0.10.0-sandbox`. We will provide
33-
upgrade guides wherever possible, especially when they are used in production already.
19+
- **Graduated services** are mature, stable implementations of proven concepts.
20+
They rarely change in backwards incompatible ways. A service is considered
21+
graduated if the major version is >= 1, e.g. `v1.0.1`, `v2.2.2`. Backwards
22+
incompatible changes are indicated by a bump of the major version number.
23+
Most, if not all, REST APIs will provide backwards compatible transformations
24+
that make it possible to interact with the server using older API versions.
25+
- **Incubating services** implement well defined but not fully matured concepts.
26+
Incubating services have a major version number of `0`, e.g. `v0.10.0`. They
27+
have a higher (but overall moderate) probability for larger changes that can
28+
break backwards compatibility, for which there are upgrade guides.
29+
- **Sandbox services** implement concepts, APIs and CLIs at the experimental
30+
stage and can change in unpredictable ways. These services have a major
31+
version number of `0` and the `sandbox` label, e.g. `v0.10.0-sandbox`. We will
32+
provide upgrade guides wherever possible, especially when they are used in
33+
production already.
3434

3535
To make deployment easier but stay compatible with semantic versioning, each
3636
service is equipped with a `oryOS` version number denoted by `+oryOS.X` where

docs/hydra/configuration.md

+7-12
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
---
2-
id: configuration
3-
title: Configuration
4-
---
5-
6-
```yaml
1+
---
2+
id: configuration
3+
title: Configuration
4+
---
5+
6+
```yaml
77
# ORY Hydra Configuration
88
#
99
#
@@ -190,7 +190,6 @@ serve:
190190
# If set to true, adds additional log output to debug server side CORS issues. Defaults to false.
191191
debug: true
192192

193-
194193
# tls configures HTTPS (HTTP over TLS). If configured, the server automatically supports HTTP/2.
195194
tls:
196195
# key configures the private key (pem encoded)
@@ -294,7 +293,6 @@ oidc:
294293

295294
# dynamic_client_registration configures OpenID Connect Dynamic Client Registration (exposed as admin endpoints /clients/...)
296295
dynamic_client_registration:
297-
298296
# The OpenID Connect Dynamic Client Registration specification has no concept of whitelisting OAuth 2.0 Scope. If you
299297
# want to expose Dynamic Client Registration, you should set the default scope enabled for newly registered clients.
300298
# Keep in mind that users can overwrite this default by setting the "scope" key in the registration payload,
@@ -306,7 +304,6 @@ oidc:
306304

307305
urls:
308306
self:
309-
310307
# This value will be used as the "issuer" in access and ID tokens. It must be
311308
# specified and using HTTPS protocol, unless --dangerous-force-http is set. This should typically be equal
312309
# to the public value.
@@ -386,7 +383,6 @@ secrets:
386383
- this-is-an-old-secret
387384
- this-is-another-old-secret
388385

389-
390386
# Enables profiling if set. Use "cpu" to enable cpu profiling and "mem" to enable memory profiling. For more details
391387
# on profiling, head over to: https://blog.golang.org/profiling-go-programs
392388
profiling: cpu
@@ -418,5 +414,4 @@ tracing:
418414
value: 1.0
419415
# The address of jaeger-agent's HTTP sampling server
420416
server_url: http://localhost:5778/sampling
421-
```
422-
417+
```

docs/hydra/oauth2.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ logout provider fetches information about the logout request:
550550
challenge = req.url.query.logout_challenge;
551551

552552
fetch(
553-
"https://hydra/oauth2/auth/requests/logout?" +
553+
'https://hydra/oauth2/auth/requests/logout?' +
554554
querystring.stringify({ logout_challenge: challenge })
555555
)
556556
.then(function(response) {
@@ -588,10 +588,10 @@ completed as follows:
588588

589589
```node
590590
fetch(
591-
"https://hydra/oauth2/auth/requests/logout/accept?" +
591+
'https://hydra/oauth2/auth/requests/logout/accept?' +
592592
querystring.stringify({ logout_challenge: challenge }),
593593
{
594-
method: "PUT"
594+
method: 'PUT',
595595
}
596596
)
597597
.then(function(response) {
@@ -607,10 +607,10 @@ You can also reject a logout request (e.g. if the user chose to not log out):
607607

608608
```node
609609
fetch(
610-
"https://hydra/oauth2/auth/requests/logout/reject?" +
610+
'https://hydra/oauth2/auth/requests/logout/reject?' +
611611
querystring.stringify({ logout_challenge: challenge }),
612612
{
613-
method: "PUT"
613+
method: 'PUT',
614614
}
615615
).then(function(response) {
616616
// Now you can do whatever you want - redirect the user back to your home page or whatever comes to mind.

docs/hydra/sdk/js.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ npm install --save ory-hydra-sdk
1818
#### Basic configuration
1919

2020
```js
21-
const Hydra = require("ory-hydra-sdk");
21+
const Hydra = require('ory-hydra-sdk');
2222

2323
// Set this to Hydra's URL
24-
Hydra.ApiClient.instance.basePath = "http://localhost:4445";
24+
Hydra.ApiClient.instance.basePath = 'http://localhost:4445';
2525
```
2626

2727
### API Usage
@@ -37,9 +37,9 @@ hydra.listOAuth2Clients((error, data, response) => {
3737
} else if (response.statusCode < 200 || response.statusCode >= 400) {
3838
// an application error occurred.
3939
throw new Error(
40-
"Consent endpoint gave status code " +
40+
'Consent endpoint gave status code ' +
4141
response.statusCode +
42-
", but status code 200 was expected."
42+
', but status code 200 was expected.'
4343
);
4444
}
4545

docs/performance/hydra.md

+28-19
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,35 @@ id: hydra
33
title: ORY Hydra
44
---
55

6-
In this document you will find benchmark results for different endpoints of ORY Hydra. All benchmarks are executed
7-
using [rakyll/hey](https://github.com/rakyll/hey). Please note that these benchmarks run against the in-memory storage
8-
adapter of ORY Hydra. These benchmarks represent what performance you would get with a zero-overhead database implementation.
9-
10-
We do not include benchmarks against databases (e.g. MySQL, PostgreSQL or CockroachDB) as the performance greatly differs between
11-
deployments (e.g. request latency, database configuration) and tweaking individual things may greatly improve performance.
12-
We believe, for that reason, that benchmark results for these database adapters are difficult to generalize and potentially
6+
In this document you will find benchmark results for different endpoints of ORY
7+
Hydra. All benchmarks are executed using
8+
[rakyll/hey](https://github.com/rakyll/hey). Please note that these benchmarks
9+
run against the in-memory storage adapter of ORY Hydra. These benchmarks
10+
represent what performance you would get with a zero-overhead database
11+
implementation.
12+
13+
We do not include benchmarks against databases (e.g. MySQL, PostgreSQL or
14+
CockroachDB) as the performance greatly differs between deployments (e.g.
15+
request latency, database configuration) and tweaking individual things may
16+
greatly improve performance. We believe, for that reason, that benchmark results
17+
for these database adapters are difficult to generalize and potentially
1318
deceiving. They are thus not included.
1419

15-
This file is updated on every push to master. It thus represents the benchmark data for the latest version.
20+
This file is updated on every push to master. It thus represents the benchmark
21+
data for the latest version.
1622

17-
All benchmarks run 10.000 requests in total, with 100 concurrent requests. All benchmarks run on Circle-CI with a
23+
All benchmarks run 10.000 requests in total, with 100 concurrent requests. All
24+
benchmarks run on Circle-CI with a
1825
["2 CPU cores and 4GB RAM"](https://support.circleci.com/hc/en-us/articles/360000489307-Why-do-my-tests-take-longer-to-run-on-CircleCI-than-locally-)
1926
configuration.
2027

2128
## BCrypt
2229

23-
ORY Hydra uses BCrypt to obfuscate secrets of OAuth 2.0 Clients. When using flows such as the OAuth 2.0 Client Credentials
24-
Grant, ORY Hydra validates the client credentials using BCrypt which causes (by design) CPU load. CPU load and performance
25-
depend on the BCrypt cost which can be set using the environment variable `BCRYPT_COST`. For these benchmarks,
26-
we have set `BCRYPT_COST=8`.
30+
ORY Hydra uses BCrypt to obfuscate secrets of OAuth 2.0 Clients. When using
31+
flows such as the OAuth 2.0 Client Credentials Grant, ORY Hydra validates the
32+
client credentials using BCrypt which causes (by design) CPU load. CPU load and
33+
performance depend on the BCrypt cost which can be set using the environment
34+
variable `BCRYPT_COST`. For these benchmarks, we have set `BCRYPT_COST=8`.
2735

2836
## OAuth 2.0
2937

@@ -39,7 +47,7 @@ Summary:
3947
Fastest: 0.0003 secs
4048
Average: 0.0220 secs
4149
Requests/sec: 4265.3079
42-
50+
4351
Total data: 1550000 bytes
4452
Size/request: 155 bytes
4553
@@ -92,7 +100,7 @@ Summary:
92100
Fastest: 0.0171 secs
93101
Average: 0.1901 secs
94102
Requests/sec: 501.9053
95-
103+
96104
Total data: 1570000 bytes
97105
Size/request: 157 bytes
98106
@@ -137,8 +145,9 @@ Status code distribution:
137145

138146
### Creating OAuth 2.0 Clients
139147

140-
This endpoint uses [BCrypt](#bcrypt) and generates IDs and secrets by reading from which negatively impacts
141-
performance. Performance will be better if IDs and secrets are set in the request as opposed to generated by ORY Hydra.
148+
This endpoint uses [BCrypt](#bcrypt) and generates IDs and secrets by reading
149+
from which negatively impacts performance. Performance will be better if IDs and
150+
secrets are set in the request as opposed to generated by ORY Hydra.
142151

143152
```
144153
This test is currently disabled due to issues with /dev/urandom being inaccessible in the CI.
@@ -154,7 +163,7 @@ Summary:
154163
Fastest: 0.0001 secs
155164
Average: 0.0037 secs
156165
Requests/sec: 24815.7713
157-
166+
158167
Total data: 4820000 bytes
159168
Size/request: 482 bytes
160169
@@ -205,7 +214,7 @@ Summary:
205214
Fastest: 0.0001 secs
206215
Average: 0.0035 secs
207216
Requests/sec: 26457.0881
208-
217+
209218
Total data: 4800000 bytes
210219
Size/request: 480 bytes
211220

website/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
"rename-version": "docusaurus-rename-version",
1414
"api": "npm-run-all swagger:generate:* swagger:cleanup:*",
1515
"serve": "serve -p 9009 ./build",
16-
"format:markdown": "prettier --write --print-width 80 --prose-wrap always \"{../docs/**,..}/*.md\"",
17-
"format:code": "prettier --single-quote --trailing-comma es5 --write \"./**/*.{js,css,html}\"",
16+
"format:markdown": "prettier --write \"{../docs/**,..}/*.md\"",
17+
"format:code": "prettier --write \"./**/*.{js,css,html}\"",
1818
"format:json": "prettier --write '../**/*.json' '!../_legacy/**'",
1919
"format": "npm-run-all -p format:*",
2020
"swagger:generate:hydra": "widdershins -u ../.widdershins/templates -e ../.widdershins/config.json ../apis/hydra.json -o ../docs/hydra/sdk/api.md",

0 commit comments

Comments
 (0)