vrcauthproxy ci test
Find a file
MiscFrizzy 4936481ffc ### Commit Message Summary
**Enhancements to Redis Integration and Testing**

- **RedisService.cs**:
  - Implemented a Redis service for storing and retrieving authentication tokens.
  - Added methods for saving, retrieving, and removing tokens using Redis.
  - Introduced a constructor for dependency injection to facilitate testing.

- **RedisFixture.cs**:
  - Created a test fixture to ensure a Redis instance is available for integration tests.
  - Implemented a check to verify if Redis is running before executing tests.

- **ProgramRedisIntegrationTests.cs**:
  - Added integration tests to validate the login process and token storage in Redis.
  - Implemented tests to check the reuse of stored tokens and the correct handling of authentication.

- **RedisIntegrationTests.cs**:
  - Developed integration tests for saving, retrieving, and deleting authentication tokens in Redis.
  - Ensured that all tokens are correctly stored and can be retrieved as expected.

- **RedisServiceTests.cs**:
  - Created unit tests using an in-memory implementation of the Redis service for isolated testing.
  - Validated the functionality of saving, retrieving, and removing tokens without a real Redis connection.

### Notes
- All tests are designed to ensure the reliability of the Redis integration and the overall functionality of the VRCAuthProxy service.
- Integration tests are marked to skip execution unless a Redis instance is available.
2025-04-07 08:04:52 -04:00
.github feat(ci): Add support for version tagging in Docker build workflow 2025-04-07 07:06:15 -04:00
Tests ### Commit Message Summary 2025-04-07 08:04:52 -04:00
VRCAuthProxy ### Commit Message Summary 2025-04-07 08:04:52 -04:00
.dockerignore Initial Commit 2024-11-11 14:15:51 -05:00
.gitignore feat(ci): Add GitHub Actions workflows for test automation and status badges 2025-04-07 06:30:31 -04:00
docker-compose.yml feat: An Initias Redis Store Implementation 2025-04-07 07:47:27 -04:00
Dockerfile add curl to container 2025-02-26 13:15:18 -05:00
Dockerfile.test feat(ci): Add GitHub Actions workflows for test automation and status badges 2025-04-07 06:30:31 -04:00
LICENSE.md Small licences adendum addition, updates readme with upcoming features list 2025-03-27 16:51:53 -04:00
README.md Update README.md 2025-04-07 06:57:17 -04:00
VRCAuthProxy.sln feat(ci): Add GitHub Actions workflows for test automation and status badges 2025-04-07 06:30:31 -04:00

VRCAuthProxy

A VRChat API Authorization Proxy Service

Build Tests Version Libraries.io dependency status for GitHub repo License

This authorization proxy service is for consuming the VRChat API in a multi-application / microservice architecture. Configure the proxy with the credentials for accounts you use to make API calls and direct your API clients to the proxy service instead of the VRChat API. The proxy server will handle the authorization call flow and caching of the authorization tokens for subsequent authorized calls.

Build Steps

C# Binary Builds RUN dotnet build "VRCAuthProxy.csproj" -c $BUILD_CONFIGURATION -o /app/build

Docker Service Build docker build -t pridevr/vrcauthproxy .

Production Image

Docker Hub

docker pull pridevr/vrcauthproxy:1

Configuring

appsettings.json

{
  "accounts": [
    {
      "username": "username",
      "password": "password", 
      "totpSecret": "totp secret" // code given to you during 2FA/MFA setup process
    }
  ]
}

Running

docker run docker run -v ./authproxy.json:/app/appsettings.json -d pridevr/vrcauthproxy:1

docker compose

services:
  authproxy:
    image: pridevr/vrcauthproxy:1
    restart: unless-stopped
    volumes:
      - ./authproxy.json:/app/appsettings.json
    healthcheck:
      test: ["CMD-SHELL", "curl -f http://localhost:8080/ || exit 1"]
      interval: 30s
      retries: 5
      timeout: 10s

Testing

This section provides instructions on how to run the unit and integration tests for the VRCAuthProxy project.

Running Tests Locally

To run the tests locally, ensure you have the .NET SDK installed. You can execute the tests using the following command:

dotnet test

For code coverage reports, you can use:

dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=lcov /p:CoverletOutput=./lcov.info

Running Tests in a Docker Container

To run the tests in a Docker container, follow these steps:

  1. Build the Docker Image: Ensure you have the Dockerfile set up correctly in your project root. Build the Docker image using the following command:

    docker build -t vrcauthproxy-test -f Dockerfile.test .
    
  2. Run the Tests: Execute the tests inside the Docker container with the following command:

    docker run --rm vrcauthproxy-test dotnet test
    

This command will run the tests in the container and output the results to your terminal.

Creating a Dockerfile.test

You can create a dedicated Dockerfile for testing:

FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build

WORKDIR /app

# Copy csproj and restore dependencies
COPY *.sln ./
COPY VRCAuthProxy/*.csproj ./VRCAuthProxy/
COPY Tests/*.csproj ./Tests/
RUN dotnet restore

# Copy the remaining files
COPY . ./

# Run tests
ENTRYPOINT ["dotnet", "test", "--logger:console"]

Continuous Integration

The test suite is designed to be run in CI/CD pipelines. Include the following in your GitHub workflow:

- name: Test
  run: dotnet test --no-restore --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=lcov /p:CoverletOutput=./lcov.info

LICENSE

MPL-2.0 with Addendum

Upcoming Features

  1. Environment variable configuration
  2. Memcache / Redis authorization state session storage

Contributors

Contributors

Contributors list made with contrib.rocks.

© 2025 PrideVR, INC

A VR Pride Organization