Skip to content

feat: add redis database to store the jwt tokens #42

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

Open
wants to merge 32 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
32ae795
refactor: convert to file-scoped namespaces
osm-Jatin Jun 15, 2025
71073b1
chore: apply dotnet format changes
osm-Jatin Jun 15, 2025
9d714d6
refactor: renamed project from DocumentService to OsmoDoc and updated…
osm-Jatin Jun 15, 2025
513819c
refactor: update Dockerfile and docker-compose for OsmoDoc rename
osm-Jatin Jun 15, 2025
570d94f
refactor: update docs directory for OsmoDoc rename
osm-Jatin Jun 15, 2025
9750310
docs: update GitHub documentation files after OsmoDoc rename
osm-Jatin Jun 15, 2025
c0faf50
fix: correct placeholder replacement to avoid extra curly braces in o…
osm-Jatin Jun 16, 2025
78f5ab2
chore: enable nullable reference types in project
osm-Jatin Jun 16, 2025
e9e470f
refactor: streamline PdfDocumentGenerator for cross-platform and NuGe…
osm-Jatin Jun 16, 2025
5358449
feat: configure OsmoDocPdfConfig.WkhtmltopdfPath from app settings
osm-Jatin Jun 16, 2025
7b4db39
feat: add process exit-code check and quote windows tool path to surv…
Jatin-1602 Jun 17, 2025
9bb0fbf
fix: initialize Placeholders list
Jatin-1602 Jun 17, 2025
9d1e0c1
fix: initialise WordDocumentDataRequestDTO non-nullable list properties
Jatin-1602 Jun 17, 2025
54cb335
chore: add project metadata to OsmoDoc.csproj file
osm-Jatin Jun 18, 2025
ce7c55e
feat: make PdfDocumentGenerator class methods asynchronous
osm-Jatin Jun 18, 2025
4ab72ad
feat: add await operator for GeneratePdf function call
osm-Jatin Jun 18, 2025
295d985
feat: make GenerateDocumentByTemplate class methods asynchronous
osm-Jatin Jun 18, 2025
548252e
refactor: remove using block in GetXWPFDocument function
osm-Jatin Jun 18, 2025
d189276
feat: add null checks for ejsData and function parameters
osm-Jatin Jun 19, 2025
325426a
feat: avoid temporary path collisions under concurrent requests by ad…
osm-Jatin Jun 19, 2025
4950f3e
refactor: initialize PDF tool path once at startup
osm-Jatin Jun 19, 2025
3f78650
feat: handle row cell-count mismatch when populating tables
osm-Jatin Jun 19, 2025
5f0e3bf
feat: avoid Task.Run for I/O operations and fix resource disposal
osm-Jatin Jun 19, 2025
4036fb7
docs: update example env
osm-Jatin Jun 18, 2025
1a4dcdd
feat: add login endpoint for generating jwt token
osm-Jatin Jun 19, 2025
a45e495
feat: add Redis service to docker-compose for token storage
osm-Jatin Jun 18, 2025
be6ff13
chore: add StackExchange.Redis package for Redis integration
osm-Jatin Jun 18, 2025
76fcfbf
feat: implement RedisTokenService for JWT token storage and validation
osm-Jatin Jun 18, 2025
1057e4d
feat: add endpoint for revoking token and update login endpoint to sa…
osm-Jatin Jun 19, 2025
104a56a
feat: make header parsing case-insensitive
osm-Jatin Jun 20, 2025
2994eeb
feat: add cancellation token for async operations and pass HttpContex…
osm-Jatin Jun 20, 2025
67d9179
fix: the typo in _tokenStoreService
osm-Jatin Jun 21, 2025
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
5 changes: 4 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
JWT_KEY=xxx
JWT_KEY=PLACEHOLDER_REPLACE_WITH_STRONG_KEY_MIN_32_CHARS_BEFORE_USE

REDIS_URL=redis:6379
REDIS_PORT=6379
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE/pull_request_template_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

### Pre-requisites

- [ ] I have gone through the Contributing guidelines for [Submitting a Pull Request (PR)](https://github.com/OsmosysSoftware/document-service/blob/main/CONTRIBUTING.md#submitting-a-pull-request-pr) and ensured that this is not a duplicate PR.
- [ ] I have gone through the Contributing guidelines for [Submitting a Pull Request (PR)](https://github.com/OsmosysSoftware/osmodoc/blob/main/CONTRIBUTING.md#submitting-a-pull-request-pr) and ensured that this is not a duplicate PR.
- [ ] I have performed unit testing for the new feature added or updated to ensure the new features added are working as expected.
- [ ] I have performed preliminary testing to ensure that any existing features are not impacted and any new features are working as expected as a whole.
- [ ] I have added/updated the `.env.example` file with the required values as applicable.
Expand Down
32 changes: 16 additions & 16 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Contributing to DocumentService
Welcome to the document-service project! We appreciate your interest in contributing to the project and making it even better. As a contributor,
# Contributing to OsmoDoc
Welcome to the osmodoc project! We appreciate your interest in contributing to the project and making it even better. As a contributor,
please follow the guidelines outlined below:

## Table of contents
Expand All @@ -13,8 +13,8 @@ please follow the guidelines outlined below:
## Got a question or problem?

**If you have questions or encounter problems, please refrain from opening issues for general support questions**. GitHub issues are primarily for bug
reports and feature requests. For general questions and support, consider using [Stack Overflow](https://stackoverflow.com/questions/tagged/document-service)
and tag your questions with the `document-service` tag. Here's why Stack Overflow is a preferred platform:
reports and feature requests. For general questions and support, consider using [Stack Overflow](https://stackoverflow.com/questions/tagged/osmodoc)
and tag your questions with the `osmodoc` tag. Here's why Stack Overflow is a preferred platform:

- Questions and answers are publicly available, helping others.
- The voting system on Stack Overflow highlights the best answers.
Expand All @@ -23,8 +23,8 @@ To save time for both you and us, we will close issues related to general suppor

## Found any issues and bugs

If you find a bug in the source code, you can help us by [submitting an issue](https://github.com/OsmosysSoftware/document-service/issues/new)
to our GitHub Repository. Even better, you can submit a [pull request](https://github.com/OsmosysSoftware/document-service/pulls) with a fix.
If you find a bug in the source code, you can help us by [submitting an issue](https://github.com/OsmosysSoftware/osmodoc/issues/new)
to our GitHub Repository. Even better, you can submit a [pull request](https://github.com/OsmosysSoftware/osmodoc/pulls) with a fix.

## Submission guidelines

Expand All @@ -34,19 +34,19 @@ Before you submit an issue, please check the issue tracker to see if a similar i

For us to address and fix a bug, we need to reproduce it. Thus when submitting a bug report, we will ask for a minimal reproduction scenario using a repository or [Gist](https://gist.github.com/). Providing a live, reproducible scenario helps us understand the issue better. Information to include:

- The version of the document-service you are using.
- The version of the osmodoc you are using.
- Any third-party libraries and their versions.
- A use-case that demonstrates the issue.

Without a minimal reproduction, we may need to close the issue due to insufficient information.

You can file new issues using our [new issue form](https://github.com/OsmosysSoftware/document-service/issues/new).
You can file new issues using our [new issue form](https://github.com/OsmosysSoftware/osmodoc/issues/new).

### Submitting a pull request (PR)

Before submitting a Pull Request (PR), please follow these guidelines:

1. Search GitHub [pull requests](https://github.com/OsmosysSoftware/document-service/pulls) to ensure there is no open or closed PR
1. Search GitHub [pull requests](https://github.com/OsmosysSoftware/osmodoc/pulls) to ensure there is no open or closed PR
related to your submission.
2. Fork this repository.
3. Make your changes in a new Git branch.
Expand All @@ -63,12 +63,12 @@ Before submitting a Pull Request (PR), please follow these guidelines:
```shell
git push origin my-fix-branch
```
7. Send a pull request to the `document-service:main`.
7. Send a pull request to the `osmodoc:main`.

- <strong style="color:black"></strong> **If we suggest changes, then:**
- Make the required updates.
- Ensure that your changes do not break existing functionality or introduce new issues.
- Rebase your branch and force push to your GitHub repository. This will update your Pull Request.
- <strong style="color:black">�</strong> **If we suggest changes, then:**
- � Make the required updates.
- � Ensure that your changes do not break existing functionality or introduce new issues.
- � Rebase your branch and force push to your GitHub repository. This will update your Pull Request.

That's it! Thank you for your contribution!

Expand All @@ -90,7 +90,7 @@ To ensure consistency throughout the source code, follow these rules as you work
## Commit message guidelines

In this project, we have specific rules for formatting our Git commit messages. These guidelines result in more readable messages that are easy
to follow when reviewing the project's history. Additionally, we use these commit messages to **generate the document-service change log**.
to follow when reviewing the project's history. Additionally, we use these commit messages to **generate the osmodoc change log**.

### Commit message format

Expand All @@ -110,7 +110,7 @@ on GitHub as well as in various git tools.

Footer should contain a [closing reference to an issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) if any.

Samples: (even more [samples](https://github.com/OsmosysSoftware/document-service/commits/main))
Samples: (even more [samples](https://github.com/OsmosysSoftware/osmodoc/commits/main))
`docs: update change log to beta.5`
`fix: need to depend on latest rxjs and zone.js`

Expand Down
14 changes: 7 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ EXPOSE 5000
ENV BUILD_CONFIGURATION=Debug

# Copy data
COPY ["DocumentService.API/DocumentService.API.csproj", "DocumentService.API/"]
COPY ["DocumentService/DocumentService.csproj", "DocumentService/"]
COPY ["OsmoDoc.API/OsmoDoc.API.csproj", "OsmoDoc.API/"]
COPY ["OsmoDoc/OsmoDoc.csproj", "OsmoDoc/"]

# Restore the project dependencies
RUN dotnet restore "./DocumentService.API/./DocumentService.API.csproj"
RUN dotnet restore "./DocumentService/./DocumentService.csproj"
RUN dotnet restore "./OsmoDoc.API/./OsmoDoc.API.csproj"
RUN dotnet restore "./OsmoDoc/./OsmoDoc.csproj"

# Copy the rest of the data
COPY . .
WORKDIR "/app/DocumentService.API"
WORKDIR "/app/OsmoDoc.API"

# Build the project and store artifacts in /out folder
RUN dotnet publish "./DocumentService.API.csproj" -c BUILD_CONFIGURATION -o /app/out
RUN dotnet publish "./OsmoDoc.API.csproj" -c BUILD_CONFIGURATION -o /app/out

# Use the official ASP.NET runtime image as the base image
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
Expand All @@ -45,4 +45,4 @@ RUN chmod 755 /usr/bin/wkhtmltopdf
RUN npm install -g --only=prod ejs

# Set the entry point for the container
ENTRYPOINT ["dotnet", "DocumentService.API.dll"]
ENTRYPOINT ["dotnet", "OsmoDoc.API.dll"]
14 changes: 0 additions & 14 deletions DocumentService/DocumentService.csproj

This file was deleted.

10 changes: 0 additions & 10 deletions DocumentService/Pdf/Models/ContentMetaData.cs

This file was deleted.

11 changes: 0 additions & 11 deletions DocumentService/Pdf/Models/DocumentData.cs

This file was deleted.

213 changes: 0 additions & 213 deletions DocumentService/Pdf/PdfDocumentGenerator.cs

This file was deleted.

Loading