Skip to content

Commit

Permalink
SMQ-209 - Fix Warnings for .svg Files During npm run build (#214)
Browse files Browse the repository at this point in the history
* upgrade image sizes

Signed-off-by: Musilah <[email protected]>

* fix md file path

Signed-off-by: Musilah <[email protected]>

* add markdownlint-cli

Signed-off-by: Musilah <[email protected]>

* update node version

Signed-off-by: Musilah <[email protected]>

* fix rebase

Signed-off-by: Musilah <[email protected]>

* remove yarn

Signed-off-by: Musilah <[email protected]>

* remove yarn in workflows

Signed-off-by: Musilah <[email protected]>

* remove homepage

Signed-off-by: Musilah <[email protected]>

* add mermaid support

Signed-off-by: Musilah <[email protected]>

* delete homepage files

Signed-off-by: Musilah <[email protected]>

---------

Signed-off-by: Musilah <[email protected]>
  • Loading branch information
Musilah authored Dec 20, 2024
1 parent 6b84d6b commit 586a8cb
Show file tree
Hide file tree
Showing 41 changed files with 2,102 additions and 20,086 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,18 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn
node-version: 20
cache: "npm"

- name: Install dependencies
run: yarn install --frozen-lockfile
run: npm install

- name: Lint Markdown Files
run: |
npx markdownlint '../../docs/**/*.md'
- name: Build the website
run: yarn build
run: npm run build

- name: Upload Build Artifact
uses: actions/upload-pages-artifact@v3
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,15 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 18
cache: yarn
node-version: 20
cache: "npm"

- name: Install dependencies
run: yarn install --frozen-lockfile
run: npm install

- name: Lint Markdown Files
run: |
npx markdownlint '../../docs/**/*.md'
- name: Test Build the website
run: yarn build
run: npm run build
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,23 +40,23 @@ Please adhere to the coding conventions used throughout the project. If in doubt
To contribute to the project, [fork](https://help.github.com/articles/fork-a-repo/) it,
clone your fork repository and configure the remotes:

```
```bash
git clone https://github.com/<your-username>/docs.git
cd docs
git remote add upstream https://github.com/absmach/magistrala-docs.git
```

If your cloned repository is behind the upstream commits, then get the latest changes from upstream:

```
```bash
git checkout main
git pull --rebase upstream main
```

Create a new topic branch from `main` using the naming convention `SMQ-[issue-number]`
to help us keep track of your contribution scope:

```
```bash
git checkout -b SMQ-[issue-number]
```

Expand All @@ -73,13 +73,13 @@ and `user.email` git configs, you can sign your commit automatically with `git c

Locally merge (or rebase) the upstream development branch into your topic branch:

```
```bash
git pull --rebase upstream main
```

Push your topic branch up to your fork:

```
```bash
git push origin SMQ-[issue-number]
```

Expand Down
31 changes: 17 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# SuperMQ

[![license][license]](LICENSE)
[build][build]
[![Build](https://github.com/absmach/supermq-docs/actions/workflows/pages.yaml/badge.svg?branch=main)](https://github.com/absmach/supermq-docs/actions/workflows/pages.yaml)

This repo collects the collaborative work on SuperMQ documentation.
Expand All @@ -14,35 +13,39 @@ This website is built using [Docusaurus](https://docusaurus.io/), a modern stati
## Prerequisites

Install [Docusaurus](https://docusaurus.io/docs/installation)
Ensure that you have [Docusaurus](https://docusaurus.io/docs/installation) installed on your system.

### Installation

```
$ yarn
```
## Installation

Doc repo can be fetched from GitHub:

```bash
git clone [email protected]:/absmach/supermq-docs.git
```

### Local Development
Use Docusaurus to serve documentation.
Install the required dependencies using:

```
$ yarn start
```bash
npm install
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
## Build

### Build
Build the documentation site using the following command:

```bash
npm run build
```
$ yarn build

## Local Development

Use Docusaurus to serve documentation.

```bash
npm run serve
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

## Contributing

Expand Down
47 changes: 28 additions & 19 deletions docs/authorization.md
Original file line number Diff line number Diff line change
Expand Up @@ -774,31 +774,35 @@ SMQ_USERS_ALLOW_SELF_REGISTER=true
## SuperMQ Personal Access Token (PAT) Authentication
### Overview
### PAT Overview
Personal Access Tokens (PATs) in SuperMQ provide a secure method for authentication and authorization, similar to JSON Web Tokens (JWTs). PATs enable fine-grained access control with customizable scopes and permissions.
### PAT Fields
PATs have the following fields:
- ID: Unique identifier for the token
- User: User ID associated with the token
- Name: User-defined name for easy identification
- Description: Explanation of the token's purpose
- Secret: Securely hashed token for authentication
- Scope: Defines the precise permissions and access levels
- IssuedAt: Timestamp of token creation
- ExpiresAt: Timestamp when the token becomes invalid
- UpdatedAt: Last modification timestamp
- LastUsedAt: Timestamp of most recent token usage
- Revoked: Boolean indicating token's active/inactive status
- RevokedAt: Timestamp of token revocation
- ID: Unique identifier for the token
- User: User ID associated with the token
- Name: User-defined name for easy identification
- Description: Explanation of the token's purpose
- Secret: Securely hashed token for authentication
- Scope: Defines the precise permissions and access levels
- IssuedAt: Timestamp of token creation
- ExpiresAt: Timestamp when the token becomes invalid
- UpdatedAt: Last modification timestamp
- LastUsedAt: Timestamp of most recent token usage
- Revoked: Boolean indicating token's active/inactive status
- RevokedAt: Timestamp of token revocation
### Scope Structure
The PAT scope defines granular permissions across different system components:
- Users: Operations that can be performed by users
- Domains: Permissions for entities within domains (groups, channels, clients)
- Dashboard: Dashboard-related operations
- Messaging: Publish and subscribe permissions
- Users: Operations that can be performed by users
- Domains: Permissions for entities within domains (groups, channels, clients)
- Dashboard: Dashboard-related operations
- Messaging: Publish and subscribe permissions
### Example Scope JSON
Expand Down Expand Up @@ -833,7 +837,8 @@ PATs have the following fields:
```
### PAT Endpoint Operations
SuperMQ exposes a couple of endpoints that allow the user to create,retrieve, update, delete and list pats.
SuperMQ exposes a couple of endpoints that allow the user to create,retrieve, update, delete and list pats.
- **Create PAT**:
Expand Down Expand Up @@ -866,6 +871,7 @@ curl --location 'http://localhost:9001/pats' \
```
Expected response:
```bash
{
"id": "ec562a21-3341-4776-81ea-165afc2a8a57",
Expand Down Expand Up @@ -905,6 +911,7 @@ curl --location 'http://localhost:9001/pats/{patID}' \
```
Expected response:
```bash
{
"id": "ec562a21-3341-4776-81ea-165afc2a8a57",
Expand Down Expand Up @@ -946,6 +953,7 @@ curl --location --request PATCH 'http://localhost:9001/pats/{patID}/name' \
```
Expected response:
```bash
{
"id": "ec562a21-3341-4776-81ea-165afc2a8a57",
Expand Down Expand Up @@ -986,6 +994,7 @@ curl --location --request DELETE 'http://localhost:9001/pats/{patID}' \
With this lets use the PAT token/secret in platform to create a client and channel and connect them.
lets create a PAT that can create any client and channel:
```bash
curl --location 'http://localhost:9001/pats' \
--header 'Content-Type: application/json' \
Expand Down Expand Up @@ -1020,7 +1029,6 @@ curl --location 'http://localhost:9001/pats' \
1. **Authentication**: The system first verifies that the PAT was legitimately issued by the platform.
2. **Authorization**: The system then checks if the requested API operation is permitted by the token's defined scope.
Example of Using PAT
- Creating a client using PATs:
Expand Down Expand Up @@ -1059,6 +1067,7 @@ curl --location 'http://localhost:9005/{domainID}/channels' \
```
- Connecting both using the created PAT:
```bash
curl --location 'http://localhost:9005/{domainID}/channels/connect' \
--header 'accept: */*' \
Expand Down
Loading

0 comments on commit 586a8cb

Please sign in to comment.