Skip to content

Commit

Permalink
fix: resolve clidoc issues
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed Mar 25, 2021
1 parent c3833af commit 8257cb2
Show file tree
Hide file tree
Showing 30 changed files with 109 additions and 95 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ node_modules: package.json
docs/node_modules: docs/package.json
cd docs; npm ci

.bin/clidoc:
.bin/clidoc: go.mod
go build -o .bin/clidoc ./cmd/clidoc/.

docs/cli: .bin/clidoc
Expand Down
8 changes: 4 additions & 4 deletions cmd/janitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@ Janitor can be used in several ways.
janitor -c /path/to/conf.yml
4. Extra *optional* parameters can also be added such as
janitor --keep-if-younger 23h --access-lifespan 1h --refresh-lifespan 40h --consent-request-lifespan 10m ...
janitor --keep-if-younger 23h --access-lifespan 1h --refresh-lifespan 40h --consent-request-lifespan 10m <database-url>
5. Running only a certain cleanup
janitor --tokens ...
janitor --tokens <database-url>
or
janitor --requests ...
janitor --requests <database-url>
or both
janitor --tokens --requests ...
janitor --tokens --requests <database-url>
`,
RunE: cli.NewHandler().Janitor.RunE,
Args: cli.NewHandler().Janitor.Args,
Expand Down
21 changes: 11 additions & 10 deletions docs/docs/cli/hydra-clients-create.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@ OAuth 2.0 Flows like the Authorize Code, Implicit, Refresh flow.
ORY Hydra implements the OpenID Connect Dynamic Client registration
specification. Most flags are supported by this command as well.

Example: hydra clients create -n "my app" -c http://localhost/cb -g
Example: hydra clients create -n &#34;my app&#34; -c http://localhost/cb -g
authorization_code -r code -a core,foobar

To encrypt auto generated client secret, use "--pgp-key", "--pgp-key-url" or
"--keybase" flag, for example: hydra clients create -n "my app" -g
client_credentials -r token -a core,foobar --keybase keybase_username
To encrypt auto generated client secret, use &#34;--pgp-key&#34;,
&#34;--pgp-key-url&#34; or &#34;--keybase&#34; flag, for example: hydra clients
create -n &#34;my app&#34; -g client_credentials -r token -a core,foobar
--keybase keybase_username

```
hydra clients create [flags]
Expand All @@ -47,19 +48,19 @@ hydra clients create [flags]
-g, --grant-types strings A list of allowed grant types (default [authorization_code])
-h, --help help for create
--id string Give the client this id
--jwks-uri string Define the URL where the JSON Web Key Set should be fetched from when performing the "private_key_jwt" client authentication method
--jwks-uri string Define the URL where the JSON Web Key Set should be fetched from when performing the &#34;private_key_jwt&#34; client authentication method
--keybase string Keybase username for encrypting client secret
--logo-uri string A URL string that references a logo for the client
-n, --name string The client's name
-n, --name string The client&#39;s name
--pgp-key string Base64 encoded PGP encryption key for encrypting client secret
--pgp-key-url string PGP encryption key URL for encrypting client secret
--policy-uri string A URL string that points to a human-readable privacy policy document that describes how the deployment organization collects, uses, retains, and discloses personal data
--post-logout-callbacks strings List of allowed URLs to be redirected to after a logout
-r, --response-types strings A list of allowed response types (default [code])
-a, --scope strings The scope the client is allowed to request
--secret string Provide the client's secret
--subject-type string A identifier algorithm. Valid values are "public" and "pairwise" (default "public")
--token-endpoint-auth-method string Define which authentication method the client may use at the Token Endpoint. Valid values are "client_secret_post", "client_secret_basic", "private_key_jwt", and "none" (default "client_secret_basic")
--secret string Provide the client&#39;s secret
--subject-type string A identifier algorithm. Valid values are &#34;public&#34; and &#34;pairwise&#34; (default &#34;public&#34;)
--token-endpoint-auth-method string Define which authentication method the client may use at the Token Endpoint. Valid values are &#34;client_secret_post&#34;, &#34;client_secret_basic&#34;, &#34;private_key_jwt&#34;, and &#34;none&#34; (default &#34;client_secret_basic&#34;)
--tos-uri string A URL string that points to a human-readable terms of service document for the client that describes a contractual relationship between the end-user and the client that the end-user accepts when authorizing the client
```

Expand All @@ -69,7 +70,7 @@ hydra clients create [flags]
--access-token string Set an access token to be used in the Authorization header, defaults to environment variable OAUTH2_ACCESS_TOKEN
--endpoint string Set the URL where ORY Hydra is hosted, defaults to environment variable HYDRA_ADMIN_URL. A unix socket can be set in the form unix:///path/to/socket
--fail-after duration Stop retrying after the specified duration (default 1m0s)
--fake-tls-termination Fake tls termination by adding "X-Forwarded-Proto: https" to http headers
--fake-tls-termination Fake tls termination by adding &#34;X-Forwarded-Proto: https&#34; to http headers
--skip-tls-verify Foolishly accept TLS certificates signed by unknown certificate authorities
```

Expand Down
4 changes: 2 additions & 2 deletions docs/docs/cli/hydra-clients-delete.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ This command deletes one or more OAuth 2.0 Clients by their respective IDs.
Example: hydra clients delete client-1 client-2 client-3

```
hydra clients delete <id> [<id>...] [flags]
hydra clients delete &lt;id&gt; [&lt;id&gt;...] [flags]
```

### Options
Expand All @@ -36,7 +36,7 @@ hydra clients delete <id> [<id>...] [flags]
--access-token string Set an access token to be used in the Authorization header, defaults to environment variable OAUTH2_ACCESS_TOKEN
--endpoint string Set the URL where ORY Hydra is hosted, defaults to environment variable HYDRA_ADMIN_URL. A unix socket can be set in the form unix:///path/to/socket
--fail-after duration Stop retrying after the specified duration (default 1m0s)
--fake-tls-termination Fake tls termination by adding "X-Forwarded-Proto: https" to http headers
--fake-tls-termination Fake tls termination by adding &#34;X-Forwarded-Proto: https&#34; to http headers
--skip-tls-verify Foolishly accept TLS certificates signed by unknown certificate authorities
```

Expand Down
4 changes: 2 additions & 2 deletions docs/docs/cli/hydra-clients-get.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ This command retrieves an OAuth 2.0 Clients by its ID.
Example: hydra clients get client-1

```
hydra clients get <id> [flags]
hydra clients get &lt;id&gt; [flags]
```

### Options
Expand All @@ -36,7 +36,7 @@ hydra clients get <id> [flags]
--access-token string Set an access token to be used in the Authorization header, defaults to environment variable OAUTH2_ACCESS_TOKEN
--endpoint string Set the URL where ORY Hydra is hosted, defaults to environment variable HYDRA_ADMIN_URL. A unix socket can be set in the form unix:///path/to/socket
--fail-after duration Stop retrying after the specified duration (default 1m0s)
--fake-tls-termination Fake tls termination by adding "X-Forwarded-Proto: https" to http headers
--fake-tls-termination Fake tls termination by adding &#34;X-Forwarded-Proto: https&#34; to http headers
--skip-tls-verify Foolishly accept TLS certificates signed by unknown certificate authorities
```

Expand Down
6 changes: 3 additions & 3 deletions docs/docs/cli/hydra-clients-import.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ Examples: hydra keys import my-set ./path/to/jwk.json ./path/to/jwk-2.json hydra
keys import my-set ./path/to/rsa.key ./path/to/rsa.pub

```
hydra clients import <set> <file-1> [<file-2> [<file-3 [<...>]]] [flags]
hydra clients import &lt;set&gt; &lt;file-1&gt; [&lt;file-2&gt; [&lt;file-3 [&lt;...&gt;]]] [flags]
```

### Options

```
-h, --help help for import
--use string Sets the "use" value of the JSON Web Key if not "use" value was defined by the key itself (default "sig")
--use string Sets the &#34;use&#34; value of the JSON Web Key if not &#34;use&#34; value was defined by the key itself (default &#34;sig&#34;)
```

### Options inherited from parent commands
Expand All @@ -47,7 +47,7 @@ hydra clients import <set> <file-1> [<file-2> [<file-3 [<...>]]] [flags]
--access-token string Set an access token to be used in the Authorization header, defaults to environment variable OAUTH2_ACCESS_TOKEN
--endpoint string Set the URL where ORY Hydra is hosted, defaults to environment variable HYDRA_ADMIN_URL. A unix socket can be set in the form unix:///path/to/socket
--fail-after duration Stop retrying after the specified duration (default 1m0s)
--fake-tls-termination Fake tls termination by adding "X-Forwarded-Proto: https" to http headers
--fake-tls-termination Fake tls termination by adding &#34;X-Forwarded-Proto: https&#34; to http headers
--skip-tls-verify Foolishly accept TLS certificates signed by unknown certificate authorities
```

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/cli/hydra-clients-list.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ hydra clients list [flags]
--access-token string Set an access token to be used in the Authorization header, defaults to environment variable OAUTH2_ACCESS_TOKEN
--endpoint string Set the URL where ORY Hydra is hosted, defaults to environment variable HYDRA_ADMIN_URL. A unix socket can be set in the form unix:///path/to/socket
--fail-after duration Stop retrying after the specified duration (default 1m0s)
--fake-tls-termination Fake tls termination by adding "X-Forwarded-Proto: https" to http headers
--fake-tls-termination Fake tls termination by adding &#34;X-Forwarded-Proto: https&#34; to http headers
--skip-tls-verify Foolishly accept TLS certificates signed by unknown certificate authorities
```

Expand Down
29 changes: 15 additions & 14 deletions docs/docs/cli/hydra-clients-update.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,19 @@ This command replaces an OAuth 2.0 Client by its ID.

Please be aware that this command replaces the entire client. To update only the
name, a full client should be provided, for example: hydra clients update
client-1 -n "my updated app" -c http://localhost/cb -g authorization_code -r
code -a core,foobar
client-1 -n &#34;my updated app&#34; -c http://localhost/cb -g
authorization_code -r code -a core,foobar

If only the name flag (-n "my updated app") is provided, the all other fields
are updated to their default values.
If only the name flag (-n &#34;my updated app&#34;) is provided, the all other
fields are updated to their default values.

To encrypt auto generated client secret, use "--pgp-key", "--pgp-key-url" or
"--keybase" flag, for example: hydra clients update client-1 -n "my updated app"
-g client_credentials -r token -a core,foobar --keybase keybase_username
To encrypt auto generated client secret, use &#34;--pgp-key&#34;,
&#34;--pgp-key-url&#34; or &#34;--keybase&#34; flag, for example: hydra clients
update client-1 -n &#34;my updated app&#34; -g client_credentials -r token -a
core,foobar --keybase keybase_username

```
hydra clients update <id> [flags]
hydra clients update &lt;id&gt; [flags]
```

### Options
Expand All @@ -47,19 +48,19 @@ hydra clients update <id> [flags]
--frontchannel-logout-session-required Boolean flag specifying whether the client requires that a sid (session ID) Claim be included in the Logout Token to identify the client session with the OP when the frontchannel-logout-callback is used. If omitted, the default value is false.
-g, --grant-types strings A list of allowed grant types (default [authorization_code])
-h, --help help for update
--jwks-uri string Define the URL where the JSON Web Key Set should be fetched from when performing the "private_key_jwt" client authentication method
--jwks-uri string Define the URL where the JSON Web Key Set should be fetched from when performing the &#34;private_key_jwt&#34; client authentication method
--keybase string Keybase username for encrypting client secret
--logo-uri string A URL string that references a logo for the client
-n, --name string The client's name
-n, --name string The client&#39;s name
--pgp-key string Base64 encoded PGP encryption key for encrypting client secret
--pgp-key-url string PGP encryption key URL for encrypting client secret
--policy-uri string A URL string that points to a human-readable privacy policy document that describes how the deployment organization collects, uses, retains, and discloses personal data
--post-logout-callbacks strings List of allowed URLs to be redirected to after a logout
-r, --response-types strings A list of allowed response types (default [code])
-a, --scope strings The scope the client is allowed to request
--secret string Provide the client's secret
--subject-type string A identifier algorithm. Valid values are "public" and "pairwise" (default "public")
--token-endpoint-auth-method string Define which authentication method the client may use at the Token Endpoint. Valid values are "client_secret_post", "client_secret_basic", "private_key_jwt", and "none" (default "client_secret_basic")
--secret string Provide the client&#39;s secret
--subject-type string A identifier algorithm. Valid values are &#34;public&#34; and &#34;pairwise&#34; (default &#34;public&#34;)
--token-endpoint-auth-method string Define which authentication method the client may use at the Token Endpoint. Valid values are &#34;client_secret_post&#34;, &#34;client_secret_basic&#34;, &#34;private_key_jwt&#34;, and &#34;none&#34; (default &#34;client_secret_basic&#34;)
--tos-uri string A URL string that points to a human-readable terms of service document for the client that describes a contractual relationship between the end-user and the client that the end-user accepts when authorizing the client
```

Expand All @@ -69,7 +70,7 @@ hydra clients update <id> [flags]
--access-token string Set an access token to be used in the Authorization header, defaults to environment variable OAUTH2_ACCESS_TOKEN
--endpoint string Set the URL where ORY Hydra is hosted, defaults to environment variable HYDRA_ADMIN_URL. A unix socket can be set in the form unix:///path/to/socket
--fail-after duration Stop retrying after the specified duration (default 1m0s)
--fake-tls-termination Fake tls termination by adding "X-Forwarded-Proto: https" to http headers
--fake-tls-termination Fake tls termination by adding &#34;X-Forwarded-Proto: https&#34; to http headers
--skip-tls-verify Foolishly accept TLS certificates signed by unknown certificate authorities
```

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/cli/hydra-clients.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Manage OAuth 2.0 Clients
--access-token string Set an access token to be used in the Authorization header, defaults to environment variable OAUTH2_ACCESS_TOKEN
--endpoint string Set the URL where ORY Hydra is hosted, defaults to environment variable HYDRA_ADMIN_URL. A unix socket can be set in the form unix:///path/to/socket
--fail-after duration Stop retrying after the specified duration (default 1m0s)
--fake-tls-termination Fake tls termination by adding "X-Forwarded-Proto: https" to http headers
--fake-tls-termination Fake tls termination by adding &#34;X-Forwarded-Proto: https&#34; to http headers
-h, --help help for clients
--skip-tls-verify Foolishly accept TLS certificates signed by unknown certificate authorities
```
Expand Down
32 changes: 18 additions & 14 deletions docs/docs/cli/hydra-janitor.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,30 +32,34 @@ reason.

Janitor can be used in several ways.

1. By passing the database connection string (DSN) as an argument Pass the
database url (dsn) as an argument to janitor. E.g. janitor <database-url>
1. By passing the database connection string (DSN) as an argument Pass the
database url (dsn) as an argument to janitor. E.g. janitor
&lt;database-url&gt;
2. By passing the DSN as an environment variable

2. By passing the DSN as an environment variable export DSN=... janitor -e
export DSN=...
janitor -e

3. By passing a configuration file containing the DSN janitor -c
/path/to/conf.yml
3. By passing a configuration file containing the DSN janitor -c
/path/to/conf.yml
4. Extra _optional_ parameters can also be added such as

4. Extra _optional_ parameters can also be added such as janitor <database-url>
--keep-if-younger 23h --access-lifespan 1h --refresh-lifespan 40h
--consent-request-lifespan 10m
janitor --keep-if-younger 23h --access-lifespan 1h --refresh-lifespan 40h --consent-request-lifespan 10m &lt;database-url&gt;

5. Running only a certain cleanup janitor <database-url> --tokens
5. Running only a certain cleanup

or
janitor --tokens &lt;database-url&gt;

janitor <database-url> --requests
or

or both
janitor --requests &lt;database-url&gt;

janitor <database-url> --tokens --requests
or both

janitor --tokens --requests &lt;database-url&gt;

```
hydra janitor <database-url> [flags]
hydra janitor [&lt;database-url&gt;] [flags]
```

### Options
Expand Down
8 changes: 4 additions & 4 deletions docs/docs/cli/hydra-keys-create.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ To improve this file please make your change against the appropriate "./cmd/*.go
Create a new JSON Web Key Set

```
hydra keys create <set> <key> [flags]
hydra keys create &lt;set&gt; &lt;key&gt; [flags]
```

### Options

```
-a, --alg string The algorithm to be used to generated they key. Supports: RS256, ES512, HS256 (default "RS256")
-a, --alg string The algorithm to be used to generated they key. Supports: RS256, ES512, HS256 (default &#34;RS256&#34;)
-h, --help help for create
-u, --use string The intended use of this key (default "sig")
-u, --use string The intended use of this key (default &#34;sig&#34;)
```

### Options inherited from parent commands
Expand All @@ -32,7 +32,7 @@ hydra keys create <set> <key> [flags]
--access-token string Set an access token to be used in the Authorization header, defaults to environment variable OAUTH2_ACCESS_TOKEN
--endpoint string Set the URL where ORY Hydra is hosted, defaults to environment variable HYDRA_ADMIN_URL
--fail-after duration Stop retrying after the specified duration (default 1m0s)
--fake-tls-termination fake tls termination by adding "X-Forwarded-Proto: https" to http headers
--fake-tls-termination fake tls termination by adding &#34;X-Forwarded-Proto: https&#34; to http headers
--skip-tls-verify Foolishly accept TLS certificates signed by unknown certificate authorities
```

Expand Down
4 changes: 2 additions & 2 deletions docs/docs/cli/hydra-keys-delete.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ To improve this file please make your change against the appropriate "./cmd/*.go
Delete a new JSON Web Key Set

```
hydra keys delete <set> [flags]
hydra keys delete &lt;set&gt; [flags]
```

### Options
Expand All @@ -30,7 +30,7 @@ hydra keys delete <set> [flags]
--access-token string Set an access token to be used in the Authorization header, defaults to environment variable OAUTH2_ACCESS_TOKEN
--endpoint string Set the URL where ORY Hydra is hosted, defaults to environment variable HYDRA_ADMIN_URL
--fail-after duration Stop retrying after the specified duration (default 1m0s)
--fake-tls-termination fake tls termination by adding "X-Forwarded-Proto: https" to http headers
--fake-tls-termination fake tls termination by adding &#34;X-Forwarded-Proto: https&#34; to http headers
--skip-tls-verify Foolishly accept TLS certificates signed by unknown certificate authorities
```

Expand Down

0 comments on commit 8257cb2

Please sign in to comment.