Skip to content

Commit

Permalink
docs: split api spec into public and admin apis
Browse files Browse the repository at this point in the history
  • Loading branch information
lfleischmann committed Sep 13, 2022
1 parent 9818e35 commit 2837845
Show file tree
Hide file tree
Showing 19 changed files with 240 additions and 118 deletions.
3 changes: 2 additions & 1 deletion backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ All available configuration parameters can be found [here](./docs/Config.md).

## API specification

The API specification can be found [here](https://docs.hanko.io/api).
- [Hanko Public API](https://docs.hanko.io/api/public)
- [Hanko Admin API](https://docs.hanko.io/api/admin)

## License
The hanko backend ist licensed under the [AGPL-3.0](LICENSE).
20 changes: 17 additions & 3 deletions docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,12 @@ const config = {
// Plugin Options for loading OpenAPI files
specs: [
{
spec: 'static/spec/api.yaml',
route: '/api',
spec: 'static/spec/public.yaml',
route: '/api/public',
},
{
spec: 'static/spec/admin.yaml',
route: '/api/admin',
},
],
// Theme Options for modifying how redoc renders them
Expand Down Expand Up @@ -127,9 +131,19 @@ const config = {
activeBaseRegex: '^((?!\/api).)*$'
},
{
to: '/api',
type: 'dropdown',
label: 'API',
position: 'left',
items: [
{
label: 'Public',
to: 'api/public'
},
{
label: 'Admin',
to: 'api/admin'
}
]
},
{
type: 'dropdown',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ <h4 class="name" id="get">
<dt class="tag-see">See:</dt>
<dd class="tag-see">
<ul>
<li><a href="https://docs.hanko.io/api#tag/.well-known/operation/getConfig">https://docs.hanko.io/api#tag/.well-known/operation/getConfig</a></li>
<li><a href="https://docs.hanko.io/api/public#tag/.well-known/operation/getConfig">https://docs.hanko.io/api/public#tag/.well-known/operation/getConfig</a></li>
</ul>
</dd>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ <h5>Parameters:</h5>
<dt class="tag-see">See:</dt>
<dd class="tag-see">
<ul>
<li><a href="https://docs.hanko.io/api#tag/Passcode/operation/passcodeFinal">https://docs.hanko.io/api#tag/Passcode/operation/passcodeFinal</a></li>
<li><a href="https://docs.hanko.io/api/public#tag/Passcode/operation/passcodeFinal">https://docs.hanko.io/api/public#tag/Passcode/operation/passcodeFinal</a></li>
</ul>
</dd>

Expand Down Expand Up @@ -1048,7 +1048,7 @@ <h5>Parameters:</h5>
<dt class="tag-see">See:</dt>
<dd class="tag-see">
<ul>
<li><a href="https://docs.hanko.io/api#tag/Passcode/operation/passcodeInit">https://docs.hanko.io/api#tag/Passcode/operation/passcodeInit</a></li>
<li><a href="https://docs.hanko.io/api/public#tag/Passcode/operation/passcodeInit">https://docs.hanko.io/api/public#tag/Passcode/operation/passcodeInit</a></li>
</ul>
</dd>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ <h5>Parameters:</h5>
<dt class="tag-see">See:</dt>
<dd class="tag-see">
<ul>
<li><a href="https://docs.hanko.io/api#tag/Password/operation/passwordLogin">https://docs.hanko.io/api#tag/Password/operation/passwordLogin</a></li>
<li><a href="https://docs.hanko.io/api/public#tag/Password/operation/passwordLogin">https://docs.hanko.io/api/public#tag/Password/operation/passwordLogin</a></li>
</ul>
</dd>

Expand Down Expand Up @@ -887,7 +887,7 @@ <h5>Parameters:</h5>
<dt class="tag-see">See:</dt>
<dd class="tag-see">
<ul>
<li><a href="https://docs.hanko.io/api#tag/Password/operation/password">https://docs.hanko.io/api#tag/Password/operation/password</a></li>
<li><a href="https://docs.hanko.io/api/public#tag/Password/operation/password">https://docs.hanko.io/api/public#tag/Password/operation/password</a></li>
</ul>
</dd>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ <h5>Parameters:</h5>
<dt class="tag-see">See:</dt>
<dd class="tag-see">
<ul>
<li><a href="https://docs.hanko.io/api#tag/User-Management/operation/createUser">https://docs.hanko.io/api#tag/User-Management/operation/createUser</a></li>
<li><a href="https://docs.hanko.io/api/public#tag/User-Management/operation/createUser">https://docs.hanko.io/api/public#tag/User-Management/operation/createUser</a></li>
</ul>
</dd>

Expand Down Expand Up @@ -616,9 +616,9 @@ <h4 class="name" id="getCurrent">
<dt class="tag-see">See:</dt>
<dd class="tag-see">
<ul>
<li><a href="https://docs.hanko.io/api#tag/User-Management/operation/IsUserAuthorized">https://docs.hanko.io/api#tag/User-Management/operation/IsUserAuthorized</a></li>
<li><a href="https://docs.hanko.io/api/public#tag/User-Management/operation/IsUserAuthorized">https://docs.hanko.io/api/public#tag/User-Management/operation/IsUserAuthorized</a></li>

<li><a href="https://docs.hanko.io/api#tag/User-Management/operation/listUser">https://docs.hanko.io/api#tag/User-Management/operation/listUser</a></li>
<li><a href="https://docs.hanko.io/api/public#tag/User-Management/operation/listUser">https://docs.hanko.io/api/public#tag/User-Management/operation/listUser</a></li>
</ul>
</dd>

Expand Down Expand Up @@ -850,7 +850,7 @@ <h5>Parameters:</h5>
<dt class="tag-see">See:</dt>
<dd class="tag-see">
<ul>
<li><a href="https://docs.hanko.io/api#tag/User-Management/operation/getUserId">https://docs.hanko.io/api#tag/User-Management/operation/getUserId</a></li>
<li><a href="https://docs.hanko.io/api/public#tag/User-Management/operation/getUserId">https://docs.hanko.io/api/public#tag/User-Management/operation/getUserId</a></li>
</ul>
</dd>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -449,9 +449,9 @@ <h5>Parameters:</h5>
<dt class="tag-see">See:</dt>
<dd class="tag-see">
<ul>
<li><a href="https://docs.hanko.io/api#tag/WebAuthn/operation/webauthnLoginInit">https://docs.hanko.io/api#tag/WebAuthn/operation/webauthnLoginInit</a></li>
<li><a href="https://docs.hanko.io/api/public#tag/WebAuthn/operation/webauthnLoginInit">https://docs.hanko.io/api/public#tag/WebAuthn/operation/webauthnLoginInit</a></li>

<li><a href="https://docs.hanko.io/api#tag/WebAuthn/operation/webauthnLoginFinal">https://docs.hanko.io/api#tag/WebAuthn/operation/webauthnLoginFinal</a></li>
<li><a href="https://docs.hanko.io/api/public#tag/WebAuthn/operation/webauthnLoginFinal">https://docs.hanko.io/api/public#tag/WebAuthn/operation/webauthnLoginFinal</a></li>

<li><a href="https://www.w3.org/TR/webauthn-2/#authentication-ceremony">https://www.w3.org/TR/webauthn-2/#authentication-ceremony</a></li>
</ul>
Expand Down Expand Up @@ -647,9 +647,9 @@ <h4 class="name" id="register">
<dt class="tag-see">See:</dt>
<dd class="tag-see">
<ul>
<li><a href="https://docs.hanko.io/api#tag/WebAuthn/operation/webauthnRegInit">https://docs.hanko.io/api#tag/WebAuthn/operation/webauthnRegInit</a></li>
<li><a href="https://docs.hanko.io/api/public#tag/WebAuthn/operation/webauthnRegInit">https://docs.hanko.io/api/public#tag/WebAuthn/operation/webauthnRegInit</a></li>

<li><a href="https://docs.hanko.io/api#tag/WebAuthn/operation/webauthnRegFinal">https://docs.hanko.io/api#tag/WebAuthn/operation/webauthnRegFinal</a></li>
<li><a href="https://docs.hanko.io/api/public#tag/WebAuthn/operation/webauthnRegFinal">https://docs.hanko.io/api/public#tag/WebAuthn/operation/webauthnRegFinal</a></li>

<li><a href="https://www.w3.org/TR/webauthn-2/#sctn-registering-a-new-credential">https://www.w3.org/TR/webauthn-2/#sctn-registering-a-new-credential</a></li>
</ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ <h1>lib/client/ConfigClient.ts</h1>
* @return {Promise&lt;Config>}
* @throws {RequestTimeoutError}
* @throws {TechnicalError}
* @see https://docs.hanko.io/api#tag/.well-known/operation/getConfig
* @see https://docs.hanko.io/api/public#tag/.well-known/operation/getConfig
*/
get() {
return new Promise&lt;Config>((resolve, reject) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ <h1>lib/client/PasscodeClient.ts</h1>
* @throws {TooManyRequestsError}
* @throws {RequestTimeoutError}
* @throws {TechnicalError}
* @see https://docs.hanko.io/api#tag/Passcode/operation/passcodeInit
* @see https://docs.hanko.io/api/public#tag/Passcode/operation/passcodeInit
*/
initialize(userID: string): Promise&lt;Passcode> {
return new Promise&lt;Passcode>((resolve, reject) => {
Expand Down Expand Up @@ -170,7 +170,7 @@ <h1>lib/client/PasscodeClient.ts</h1>
* @throws {MaxNumOfPasscodeAttemptsReachedError}
* @throws {RequestTimeoutError}
* @throws {TechnicalError}
* @see https://docs.hanko.io/api#tag/Passcode/operation/passcodeFinal
* @see https://docs.hanko.io/api/public#tag/Passcode/operation/passcodeFinal
*/
finalize(userID: string, code: string): Promise&lt;void> {
const passcodeID = this.state.read().getActiveID(userID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ <h1>lib/client/PasswordClient.ts</h1>
* @throws {TooManyRequestsError}
* @throws {RequestTimeoutError}
* @throws {TechnicalError}
* @see https://docs.hanko.io/api#tag/Password/operation/passwordLogin
* @see https://docs.hanko.io/api/public#tag/Password/operation/passwordLogin
*/
login(userID: string, password: string): Promise&lt;void> {
return new Promise&lt;void>((resolve, reject) => {
Expand Down Expand Up @@ -162,7 +162,7 @@ <h1>lib/client/PasswordClient.ts</h1>
* @throws {RequestTimeoutError}
* @throws {UnauthorizedError}
* @throws {TechnicalError}
* @see https://docs.hanko.io/api#tag/Password/operation/password
* @see https://docs.hanko.io/api/public#tag/Password/operation/password
*/
update(userID: string, password: string): Promise&lt;void> {
return new Promise&lt;void>((resolve, reject) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ <h1>lib/client/UserClient.ts</h1>
* @throws {NotFoundError}
* @throws {RequestTimeoutError}
* @throws {TechnicalError}
* @see https://docs.hanko.io/api#tag/User-Management/operation/getUserId
* @see https://docs.hanko.io/api/public#tag/User-Management/operation/getUserId
*/
getInfo(email: string): Promise&lt;UserInfo> {
return new Promise&lt;UserInfo>((resolve, reject) => {
Expand Down Expand Up @@ -143,7 +143,7 @@ <h1>lib/client/UserClient.ts</h1>
* @throws {ConflictError}
* @throws {RequestTimeoutError}
* @throws {TechnicalError}
* @see https://docs.hanko.io/api#tag/User-Management/operation/createUser
* @see https://docs.hanko.io/api/public#tag/User-Management/operation/createUser
*/
create(email: string): Promise&lt;User> {
return new Promise&lt;User>((resolve, reject) => {
Expand Down Expand Up @@ -171,8 +171,8 @@ <h1>lib/client/UserClient.ts</h1>
* @throws {UnauthorizedError}
* @throws {RequestTimeoutError}
* @throws {TechnicalError}
* @see https://docs.hanko.io/api#tag/User-Management/operation/IsUserAuthorized
* @see https://docs.hanko.io/api#tag/User-Management/operation/listUser
* @see https://docs.hanko.io/api/public#tag/User-Management/operation/IsUserAuthorized
* @see https://docs.hanko.io/api/public#tag/User-Management/operation/listUser
*/
getCurrent(): Promise&lt;User> {
return new Promise&lt;User>((resolve, reject) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ <h1>lib/client/WebauthnClient.ts</h1>
* @throws {InvalidWebauthnCredentialError}
* @throws {RequestTimeoutError}
* @throws {TechnicalError}
* @see https://docs.hanko.io/api#tag/WebAuthn/operation/webauthnLoginInit
* @see https://docs.hanko.io/api#tag/WebAuthn/operation/webauthnLoginFinal
* @see https://docs.hanko.io/api/public#tag/WebAuthn/operation/webauthnLoginInit
* @see https://docs.hanko.io/api/public#tag/WebAuthn/operation/webauthnLoginFinal
* @see https://www.w3.org/TR/webauthn-2/#authentication-ceremony
*/
login(userID?: string): Promise&lt;void> {
Expand Down Expand Up @@ -191,8 +191,8 @@ <h1>lib/client/WebauthnClient.ts</h1>
* @throws {RequestTimeoutError}
* @throws {UnauthorizedError}
* @throws {TechnicalError}
* @see https://docs.hanko.io/api#tag/WebAuthn/operation/webauthnRegInit
* @see https://docs.hanko.io/api#tag/WebAuthn/operation/webauthnRegFinal
* @see https://docs.hanko.io/api/public#tag/WebAuthn/operation/webauthnRegInit
* @see https://docs.hanko.io/api/public#tag/WebAuthn/operation/webauthnRegFinal
* @see https://www.w3.org/TR/webauthn-2/#sctn-registering-a-new-credential
*/
register(): Promise&lt;void> {
Expand Down
Loading

0 comments on commit 2837845

Please sign in to comment.