Skip to content

Commit 079ba4d

Browse files
committed
Add toggle button functionality and update integration documentation
1 parent e1bd1f4 commit 079ba4d

35 files changed

Lines changed: 9512 additions & 106 deletions

README.md

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
## Architecture
22

3-
The **Google Club Unified Access System (UAS)** employs a structured architecture to manage authentication, authorization, and identity services. The system consists of two primary services, a shared database, and client interfaces designed for both users and admins, providing a secure, cohesive experience.
3+
The Google Club Unified Access System (UAS) employs a structured architecture to manage authentication, authorization, and identity services. The system consists of two primary services, a shared database, and client interfaces designed for both users and admins, providing a secure, cohesive experience.
44

55
### Core Services
66

77
1. **CAS (Central Authentication Service)**
88

9-
- **Purpose**: CAS handles authentication, using JWT (JSON Web Token) for secure token-based authentication.
10-
- **Features**:
11-
- **Fast Access to Authorities**: CAS provides quick access to user authorities, ensuring low latency.
12-
- **Cache & Authority Control**: Caches user authorities to reduce load on the database and optimize performance.
13-
- **Technology**: Built with **Express.js** for lightweight and efficient operation.
9+
- Purpose: CAS handles authentication, using JWT (JSON Web Token) for secure token-based authentication.
10+
- Features:
11+
- Fast Access to Authorities: CAS provides quick access to user authorities, ensuring low latency.
12+
- Cache & Authority Control: Caches user authorities to reduce load on the database and optimize performance.
13+
- Technology: Built with Express.js for lightweight and efficient operation.
1414

1515
2. **ICS (Identity Control Service)**
1616

17-
- **Purpose**: ICS focuses on managing identity and access control for both users and administrators.
18-
- **Features**:
19-
- **Access Management**: Configures and verifies authorities for integrated applications, with database checks to ensure accurate permissions.
20-
- **Comprehensive Identity Management**: Manages user profiles, permissions, and administrative controls.
21-
- **Technology**: Developed with **Spring Boot** for robust backend support and efficient data handling.
17+
- Purpose: ICS focuses on managing identity and access control for both users and administrators.
18+
- Features:
19+
- Access Management: Configures and verifies authorities for integrated applications, with database checks to ensure accurate permissions.
20+
- Comprehensive Identity Management: Manages user profiles, permissions, and administrative controls.
21+
- Technology: Developed with Spring Boot for robust backend support and efficient data handling.
2222

2323
### Shared Database
2424

25-
Both CAS and ICS utilize a centralized **Accounts Database** (PostgreSQL), storing essential user data and access control information with durability and security:
25+
Both CAS and ICS utilize a centralized Accounts Database (PostgreSQL), storing essential user data and access control information with durability and security:
2626

27-
- **Account Information**: Holds user profiles and core account data.
28-
- **Access Authorities**: Manages permissions across Google Club applications to ensure unified, up-to-date access control.
27+
- Account Information: Holds user profiles and core account data.
28+
- Access Authorities: Manages permissions across Google Club applications to ensure unified, up-to-date access control.
2929

3030
**Database Structure**
3131
![Database Structure](./images/accounts-database-schema.png)
@@ -36,16 +36,16 @@ The system includes two main Angular-based clients to allow users and administra
3636

3737
1. **AMWC (Account Manager Web Client)**
3838

39-
- **Audience**: End-users.
40-
- **Purpose**:
39+
- Audience: End-users.
40+
- Purpose:
4141
- Control over account details.
4242
- View authorities.
4343
- Single Sign-On (SSO) access across the ecosystem.
4444

4545
2. **ACWC (Accounts Console Web Client)**
4646

47-
- **Audience**: Administrators.
48-
- **Purpose**:
47+
- Audience: Administrators.
48+
- Purpose:
4949
- Identity verification, account management, and authority controls.
5050
- Granting, revoking, and managing permissions.
5151
- Analyzing user data and trends.
@@ -54,18 +54,18 @@ The system includes two main Angular-based clients to allow users and administra
5454

5555
Each service has dedicated APIs to facilitate requests and operations across the UAS system:
5656

57-
# Identity and Access Control Server
57+
## Identity and Access Control Server
5858

59-
- **[ICS API Endpoints](./images/ics-api-endpoints.png)** - Click to view ICS API endpoints in Postman.
59+
- [ICS API Endpoints](./images/ics-api-endpoints.png) - Click to view ICS API endpoints in Postman.
6060

61-
## 1. General Purpose
61+
### 1. General Purpose
6262

6363
- **GET** `/health-check`
6464
Health check for the server.
6565

66-
## 2. Account Manager
66+
### 2. Account Manager
6767

68-
### 2.1 Account Management
68+
#### 2.1 Account Management
6969

7070
- **POST** `/create-account`
7171
Create a new account.
@@ -86,9 +86,9 @@ Each service has dedicated APIs to facilitate requests and operations across the
8686
- **DELETE** `/delete-my-account`
8787
Delete the account.
8888

89-
### 2.2 Accounts Console
89+
#### 2.2 Accounts Console
9090

91-
#### 2.2.1 Account Management
91+
##### 2.2.1 Account Management
9292

9393
- **GET** `/search-accounts`
9494
Search for accounts.
@@ -103,7 +103,7 @@ Each service has dedicated APIs to facilitate requests and operations across the
103103
- **POST** `/lock-account`
104104
Lock an account.
105105

106-
#### 2.2.2 Role Management
106+
##### 2.2.2 Role Management
107107

108108
- **GET** `/search-roles`
109109
Search for roles.
@@ -116,7 +116,7 @@ Each service has dedicated APIs to facilitate requests and operations across the
116116
- **DELETE** `/delete-role`
117117
Delete a role.
118118

119-
#### 2.2.3 Permission Management
119+
##### 2.2.3 Permission Management
120120

121121
- **GET** `/search-permissions`
122122
Search for permissions.
@@ -131,14 +131,14 @@ Each service has dedicated APIs to facilitate requests and operations across the
131131

132132
# Centralized Authentication Service
133133

134-
- **[CAS API Endpoints](./images/cas-api-endpoints.png)** - Click to view CAS API endpoints in Postman.
134+
- [CAS API Endpoints](./images/cas-api-endpoints.png) - Click to view CAS API endpoints in Postman.
135135

136-
## 1. General Purpose
136+
### 1. General Purpose
137137

138138
- **GET** `/health-check`
139139
Health check for the service.
140140

141-
## 2. Cache Management
141+
### 2. Cache Management
142142

143143
- **GET** `/get-all-accounts-ids-in-cache`
144144
Retrieve all account IDs from cache.
@@ -149,7 +149,7 @@ Each service has dedicated APIs to facilitate requests and operations across the
149149
- **DELETE** `/clear-account-cache`
150150
Clear the cache for a specific account.
151151

152-
## 3. Authentication Management
152+
### 3. Authentication Management
153153

154154
- **POST** `/generate-jwt-token`
155155
Generate JWT token (login).
@@ -158,7 +158,7 @@ Each service has dedicated APIs to facilitate requests and operations across the
158158
- **GET** `/verify-token`
159159
Verify the validity of a token.
160160

161-
### System Communication
161+
#### System Communication
162162

163163
The UAS architecture supports smooth communication between the CAS, ICS, the shared database, and client interfaces. This integrated design supports real-time updates and centralized control over identity and access management.
164164

health.html

Lines changed: 100 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -2,99 +2,144 @@
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />
5-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
65
<title>Google Club Health Check</title>
6+
<link rel="icon" href="images/logo.png" type="image/x-icon" />
7+
<!-- start font -->
8+
<link rel="preconnect" href="https://fonts.googleapis.com" />
9+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
10+
<link
11+
href="https://fonts.googleapis.com/css2?family=Noto+Sans:ital,wght@0,100..900;1,100..900&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900&display=swap"
12+
rel="stylesheet"
13+
/>
14+
<!-- end font -->
715
<link
816
href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css"
917
rel="stylesheet"
1018
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH"
1119
crossorigin="anonymous"
1220
/>
21+
<link href="imported/css/m-styles.min.css" rel="stylesheet" />
22+
<link
23+
href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.25.0/themes/prism-okaidia.min.css"
24+
rel="stylesheet"
25+
/>
1326
<style>
14-
.server-status-item {
15-
margin-bottom: 10px;
16-
padding: 15px;
27+
body {
28+
background-color: #eee !important;
29+
font-family: "Noto Sans", sans-serif;
1730
}
1831
</style>
1932
</head>
2033
<body>
2134
<div class="container py-5">
22-
<h1 class="text-center mb-4">Google Club Servers Health Check</h1>
23-
24-
<a
25-
class="btn btn-secondary mb-4"
26-
style="text-decoration: none; color: inherit"
27-
href="index.html"
28-
>Go Back</a
35+
<h1
36+
class="text-center my-4 p-3"
37+
style="font-family: 'Poppins', sans-serif"
2938
>
39+
Google Club Servers Health Check
40+
</h1>
3041

31-
<div id="serverStatus" class="card mb-4">
32-
<div class="card-header bg-primary text-white">Server Status</div>
33-
<ul class="list-group list-group-flush"></ul>
42+
<div class="row justify-content-center ps-2">
43+
<div class="col-lg-10 col-md-12">
44+
<a href="index.html" class="m-btn green rnd">
45+
<svg
46+
xmlns="http://www.w3.org/2000/svg"
47+
viewBox="0 0 448 512"
48+
style="width: 16px; height: 16px"
49+
fill="#eee"
50+
>
51+
<path
52+
d="M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.2 288 416 288c17.7 0 32-14.3 32-32s-14.3-32-32-32l-306.7 0L214.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z"
53+
/>
54+
</svg>
55+
Go Back</a
56+
>
57+
</div>
3458
</div>
3559

36-
<div class="card">
37-
<div class="card-header bg-primary text-white">Clients</div>
38-
<div id="generatedLinks" class="list-group list-group-flush p-3"></div>
60+
<div class="row justify-content-center p-4">
61+
<div
62+
class="col-lg-10 col-md-12 border rounded shadow-sm p-5 bg-light mb-4"
63+
>
64+
<div id="serverStatus" class="card mb-4">
65+
<div class="card-header bg-primary text-white">Server Status</div>
66+
<ul class="list-group list-group-flush"></ul>
67+
</div>
68+
69+
<div class="card">
70+
<div class="card-header bg-primary text-white">Clients</div>
71+
<div
72+
id="generatedLinks"
73+
class="list-group list-group-flush p-3 pt-0"
74+
></div>
75+
</div>
76+
</div>
3977
</div>
4078
</div>
79+
4180
<script>
42-
const linksArray = [
81+
const clientsArray = [
4382
{
4483
name: "Account Management Web Client",
4584
url: "https://account-manager-eta.vercel.app",
85+
repo: "https://github.com/Wassim-Rached/Google-Club-Account-Manager-Web-Client",
4686
},
47-
// {
48-
// name: "Formular User Web Client",
49-
// url: "https://google-forms-tau.vercel.app",
50-
// },
5187
{
5288
name: "Account Console Web Client",
5389
url: "https://accounts-console.vercel.app",
90+
repo: "https://github.com/Wassim-Rached/Google-Club-Accounts-Console-Web-Client",
5491
},
55-
// {
56-
// name: "Formular Admin Web Client",
57-
// url: "https://formular-administration.vercel.app",
58-
// },
5992
];
6093

6194
function generateLinksHTML(links) {
6295
return links
6396
.map(
6497
(link) =>
65-
`<a href="${link.url}" target="_blank" class="list-group-item list-group-item-action mb-2">
66-
<span>${link.name}</span>
67-
<span class="badge bg-primary rounded-pill">Visit</span>
68-
</a>`
98+
`<li class="list-group-item ps-0 pe-0 d-flex justify-content-between align-items-center">
99+
<span>
100+
<a href="${link.url}" target="_blank">${link.name}</a>
101+
</span>
102+
<a href="${link.repo}" target="_blank" class="badge rounded-pill">
103+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512" style="width: 16px; height: 16px;">
104+
<path d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3 .3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5 .3-6.2 2.3zm44.2-1.7c-2.9 .7-4.9 2.6-4.6 4.9 .3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3 .7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3 .3 2.9 2.3 3.9 1.6 1 3.6 .7 4.3-.7 .7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3 .7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3 .7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"/>
105+
</svg>
106+
</a>
107+
</li>`
69108
)
70109
.join("");
71110
}
72111

73112
document.getElementById("generatedLinks").innerHTML =
74-
generateLinksHTML(linksArray);
113+
generateLinksHTML(clientsArray);
75114
</script>
76115
<script>
77116
const serverEndpoints = [
78-
"https://cas-server.azurewebsites.net/api/health",
79-
"https://ics-server.azurewebsites.net/api/health",
80-
// "https://fas-server.azurewebsites.net/api/health",
81-
// "https://fus-server.azurewebsites.net/api/health",
117+
{
118+
url: "https://cas-server.azurewebsites.net/api/health",
119+
repo: "https://github.com/Wassim-Rached/Google-Club-Centralized-Authentication-Service",
120+
},
121+
{
122+
url: "https://ics-server.azurewebsites.net/api/health",
123+
repo: "https://github.com/Wassim-Rached/Google-Club-Identity-And-Access-Control-Server",
124+
},
82125
];
83126

84127
async function checkServerHealth(endpoint) {
85128
try {
86-
const response = await fetch(endpoint, { timeout: 5000 }); // Set a 5-second timeout
129+
const response = await fetch(endpoint.url, { timeout: 5000 }); // Set a 5-second timeout
87130
const data = await response.json();
88131
return {
89-
url: endpoint,
132+
url: endpoint.url,
133+
repo: endpoint.repo,
90134
status: data.status,
91135
code: response.status,
92136
body: data.body,
93137
error: null,
94138
};
95139
} catch (error) {
96140
return {
97-
url: endpoint,
141+
url: endpoint.url,
142+
repo: endpoint.repo,
98143
status: "Error",
99144
code: 500,
100145
body: null,
@@ -104,21 +149,18 @@ <h1 class="text-center mb-4">Google Club Servers Health Check</h1>
104149
}
105150

106151
async function getAllServerStatuses() {
107-
const serverStatuses = await Promise.all(
108-
serverEndpoints.map(checkServerHealth)
109-
);
110-
return serverStatuses;
152+
const serverStatusList = document.querySelector("#serverStatus ul");
153+
for (const endpoint of serverEndpoints) {
154+
const serverStatus = await checkServerHealth(endpoint);
155+
const statusHTML = generateStatusHTML([serverStatus]);
156+
serverStatusList.innerHTML += statusHTML;
157+
}
111158
}
112159

113-
getAllServerStatuses()
114-
.then((serverStatuses) => {
115-
const serverStatusDiv = document.getElementById("serverStatus");
116-
serverStatusDiv.innerHTML = generateStatusHTML(serverStatuses);
117-
})
118-
.catch((error) => {
119-
console.error("Error fetching health check data:", error);
120-
serverStatusDiv.innerHTML = "Failed to fetch health check data";
121-
});
160+
getAllServerStatuses().catch((error) => {
161+
console.error("Error fetching health check data:", error);
162+
serverStatusDiv.innerHTML = "Failed to fetch health check data";
163+
});
122164

123165
function generateStatusHTML(serverStatuses) {
124166
let html = "";
@@ -140,7 +182,13 @@ <h1 class="text-center mb-4">Google Club Servers Health Check</h1>
140182
if (serverStatus.body) {
141183
html += "<br>Body: " + JSON.stringify(serverStatus.body);
142184
}
143-
html += "</span></li>";
185+
html += "</span>";
186+
html += `<a href="${serverStatus.repo}" target="_blank" class="badge rounded-pill">
187+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512" style="width: 16px; height: 16px;">
188+
<path d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3 .3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5 .3-6.2 2.3zm44.2-1.7c-2.9 .7-4.9 2.6-4.6 4.9 .3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3 .7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3 .3 2.9 2.3 3.9 1.6 1 3.6 .7 4.3-.7 .7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3 .7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3 .7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"/>
189+
</svg>
190+
</a>`;
191+
html += "</li>";
144192
});
145193
return html;
146194
}

how_to_integrate.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# Integrating Your Application with Google UAS
2-
31
Integrating with the **Google Club Unified Access System (UAS)** for authentication and authorization is a straightforward process. Here’s a step-by-step guide to get your app fully integrated with Google Club UAS.
42

53
For any assistance, please contact the admins at [contact.isetchggl@gmail.com](mailto:contact.isetchggl@gmail.com).

images/logo.png

49.3 KB
Loading

0 commit comments

Comments
 (0)