Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #6

Merged
merged 3 commits into from
Nov 12, 2024
Merged
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
23 changes: 20 additions & 3 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import type { ReactNode } from "react";
import { baseOptions } from "./layout.config";
import { DocsLayout } from "fumadocs-ui/layouts/docs";
import { source } from "@/lib/source";
// import { RootToggle } from "fumadocs-ui/layouts/docs.client";
// import Image from "next/image";
import Image from "next/image";
// import { RootToggle } from "fumadocs-ui/components/layout/root-toggle";

const inter = Inter({
subsets: ["latin"],
Expand Down Expand Up @@ -42,7 +42,24 @@ export default function Layout({ children }: { children: ReactNode }) {
// }}
{...baseOptions}
>
{children}
<div className="relative w-full">
<div className="sticky top-0 -z-10 w-full">
<div className="absolute w-full h-64 max-h-screen">
<div className="flex flex-1 justify-center">
<div className="absolute blur-xl opacity-75 bg-gradient-to-b from-orange-700 w-full -top-40 h-96 rounded-full to-transparent" />
</div>
<div className="flex flex-1 h-full mt-10 justify-end lg:mx-80">
<Image
src="/shield.svg"
alt="Shield"
width={220}
height={240}
/>
</div>
</div>
</div>
<div className="relative z-0 w-full flex">{children}</div>
</div>
</DocsLayout>
</RootProvider>
</body>
Expand Down
125 changes: 61 additions & 64 deletions assets/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,34 +54,22 @@ paths:
description: Successful response
content:
application/json: {}
/realms/{REALM_ID}/clients/{CLIENT_ID}/api-users/{API_USER_ID}:
patch:
get:
tags:
- Realm > Client > API User
summary: Update API User
requestBody:
content:
application/json:
schema:
type: object
example: "{\r\n // \"name\": \"Portal preprod - 2\",\r\n \"role\": \"realm\",\r\n \"access\": \"admin\",\r\n \"expires\": \"1m\"\r\n // \"lock\": false\r\n}"
summary: Get API Users
parameters:
- name: api-key
in: header
schema:
type: string
example: "{{MASTER_API_KEY}}"
- name: REALM_ID
in: path
schema:
type: string
required: true
- name: CLIENT_ID
- name: MASTER_REALM_ID
in: path
schema:
type: string
required: true
- name: API_USER_ID
- name: MASTER_CLIENT_ID
in: path
schema:
type: string
Expand All @@ -91,23 +79,34 @@ paths:
description: Successful response
content:
application/json: {}
/realms/{MASTER_REALM_ID}/clients/{MASTER_CLIENT_ID}/api-users:
get:
/realms/{REALM_ID}/clients/{CLIENT_ID}/api-users/{API_USER_ID}:
patch:
tags:
- Realm > Client > API User
summary: Get API Users
summary: Update API User
requestBody:
content:
application/json:
schema:
type: object
example: "{\r\n // \"name\": \"Portal preprod - 2\",\r\n \"role\": \"realm\",\r\n \"access\": \"admin\",\r\n \"expires\": \"1m\"\r\n // \"lock\": false\r\n}"
parameters:
- name: api-key
in: header
schema:
type: string
example: "{{MASTER_API_KEY}}"
- name: MASTER_REALM_ID
- name: REALM_ID
in: path
schema:
type: string
required: true
- name: MASTER_CLIENT_ID
- name: CLIENT_ID
in: path
schema:
type: string
required: true
- name: API_USER_ID
in: path
schema:
type: string
Expand All @@ -117,7 +116,6 @@ paths:
description: Successful response
content:
application/json: {}
/realms/{REALM_ID}/clients/{CLIENT_ID}/api-users/0192a464-1f55-7dc2-bf72-c61ea4351966:
delete:
tags:
- Realm > Client > API User
Expand Down Expand Up @@ -248,6 +246,47 @@ paths:
content:
application/json: {}
/realms/{REALM_ID}/users:
post:
tags:
- Auth
summary: Register
requestBody:
content:
application/json:
schema:
type: object
example:
email: appu@mksingh.in
password: "12345"
first_name: Appu
last_name: Singh
resource:
group_name: no group
identifiers:
society: 01923863-ea6e-8679-7ec5-7c044ecd8895
membership: 01923863-ea6e-7ec5-8679-7c044ecd8896
employee: 01923863-ea6e-8679-7ec5-7c044ecd8897
parameters:
- name: api-key
in: header
schema:
type: string
example: "{{API_KEY}}"
- name: REALM_ID
in: path
schema:
type: string
required: true
- name: CLIENT_ID
in: path
schema:
type: string
required: true
responses:
"200":
description: Successful response
content:
application/json: {}
get:
tags:
- Realm > User
Expand Down Expand Up @@ -443,48 +482,6 @@ paths:
description: Successful response
content:
application/json: {}
/realms/{REALM_ID}/clients/{CLIENT_ID}/auth/register:
post:
tags:
- Auth
summary: Register
requestBody:
content:
application/json:
schema:
type: object
example:
email: appu@mksingh.in
password: "12345"
first_name: Appu
last_name: Singh
resource:
group_name: no group
identifiers:
society: 01923863-ea6e-8679-7ec5-7c044ecd8895
membership: 01923863-ea6e-7ec5-8679-7c044ecd8896
employee: 01923863-ea6e-8679-7ec5-7c044ecd8897
parameters:
- name: api-key
in: header
schema:
type: string
example: "{{API_KEY}}"
- name: REALM_ID
in: path
schema:
type: string
required: true
- name: CLIENT_ID
in: path
schema:
type: string
required: true
responses:
"200":
description: Successful response
content:
application/json: {}
/realms/{REALM_ID}/clients/{CLIENT_ID}/auth/login:
post:
tags:
Expand Down
Binary file modified bun.lockb
Binary file not shown.
5 changes: 4 additions & 1 deletion content/architectural-resource/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ import { Step, Steps } from "fumadocs-ui/components/steps";
the API user is required. There can be more than one API user for a client
and each API user can have different role.
</Card>
<Card title="Signup user" href="/architectural-resource/signup-user">
<Card
title="User Registration"
href="/architectural-resource/user-registration"
>
An API user can create or register a new user to its own client.
</Card>
<Card title="Login" href="/architectural-resource/login">
Expand Down
4 changes: 2 additions & 2 deletions content/architectural-resource/login.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Admin Login
description: This is the admin login flow chart
title: Login
description: This is the login flow chart
---

import { LightImage, DarkImage } from "@/components/image-switcher";
Expand Down
2 changes: 1 addition & 1 deletion content/architectural-resource/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"pages": [
"resource-initialization",
"create-api-user",
"signup-user",
"user-registration",
"login",
"refresh-token",
"introspection"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Signup User
description: This is the signup user flow chart
title: Register User
description: This is user registration flow chart
---

import { LightImage, DarkImage } from "@/components/image-switcher";
Expand Down
3 changes: 2 additions & 1 deletion content/getting-started/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ title: Installation
description: We have a docker images for amd64 and arm64.
---

We have a docker images for `amd64` and `arm64. You can find the docker image on [docker hub](https://hub.docker.com/r/shieldauth/shield)
We have a docker images for `amd64` and `arm64`. You can find the docker image
on [docker hub](https://hub.docker.com/r/shieldauth/shield)

import { Accordion, Accordions } from "fumadocs-ui/components/accordion";

Expand Down
14 changes: 14 additions & 0 deletions content/usage-guide/api-user/create.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: Create API User
full: true
---

<APIPage
document="assets/openapi.yml"
operations={[
{
path: "/realms/{REALM_ID}/clients/{CLIENT_ID}/api-users",
method: "post",
},
]}
/>
14 changes: 14 additions & 0 deletions content/usage-guide/api-user/delete.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: Delete API User
full: true
---

<APIPage
document="assets/openapi.yml"
operations={[
{
path: "/realms/{REALM_ID}/clients/{CLIENT_ID}/api-users/{API_USER_ID}",
method: "delete",
},
]}
/>
14 changes: 14 additions & 0 deletions content/usage-guide/api-user/get.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: Get API Users
full: true
---

<APIPage
document="assets/openapi.yml"
operations={[
{
path: "/realms/{REALM_ID}/clients/{CLIENT_ID}/api-users",
method: "get",
},
]}
/>
8 changes: 8 additions & 0 deletions content/usage-guide/api-user/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: API User
description: An API user is commonly known as **API Key**. While creating the user you can assign **scope** and **access** with expiration date. The `api-key` will be generated at the time of creation of the user and will be used for further API calls.
---

An API user is commonly known as **API Key**. While creating the user you can assign
**scope** and **access** with expiration date. The `api-key` will be generated
at the time of creation of the user and will be used for further API calls.
5 changes: 5 additions & 0 deletions content/usage-guide/api-user/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"title": "API User",
"description": "An API user is commonly known as **API Key**. While creating the user you can assign **scope** and **access** with expiration date. The `api-key` will be generated at the time of creation of the user and will be used for further API calls.",
"pages": ["create", "get", "update", "delete"]
}
14 changes: 14 additions & 0 deletions content/usage-guide/api-user/update.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: Update API User
full: true
---

<APIPage
document="assets/openapi.yml"
operations={[
{
path: "/realms/{REALM_ID}/clients/{CLIENT_ID}/api-users/{API_USER_ID}",
method: "patch",
},
]}
/>
19 changes: 19 additions & 0 deletions content/usage-guide/auth/login.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
title: Login
description: This endpoint is used to authenticate a user and obtain access and refresh tokens.
full: true
---

This endpoint is used to authenticate a user and obtain `access_token` and `refresh_token`.

## Playground

<APIPage
document="assets/openapi.yml"
operations={[
{
path: "/realms/{REALM_ID}/clients/{CLIENT_ID}/auth/login",
method: "post",
},
]}
/>
21 changes: 0 additions & 21 deletions content/usage-guide/login.mdx

This file was deleted.

2 changes: 1 addition & 1 deletion content/usage-guide/meta.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"title": "Usage Guide",
"description": "You will find all the APIs guides here for easy integration.",
"pages": ["login"]
"pages": ["api-user", "users", "auth"]
}
Loading
Loading