🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

github.com/friendlycaptcha/friendly-captcha-sdk-tooling/friendly-captcha-sdk-testserver

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/friendlycaptcha/friendly-captcha-sdk-tooling/friendly-captcha-sdk-testserver

v0.0.0-20241021144704-a97fa0c80369
Source
Go
Version published
Created
Source

Friendly Captcha SDK Test Server

This module is dedicated to testing the integration of Friendly Captcha SDKs with a mocked server environment.

The goal is to unify the behavior of server side SDK implementations, especially when the API returns errors.

Installation

There are different ways to use this tool.

  • Download and unpack the binary from the latest version on the releases page.
  • Install using Go
    go install github.com/friendlycaptcha/friendly-captcha-sdk-tooling/friendly-captcha-sdk-testserver@latest
    
  • Run it using Docker
    docker run -p 1090:1090 friendlycaptcha/sdk-testserver:latest
    
  • Build it yourself (clone this repo, use go run main.go).

Running the server

# With a binary you downloaded from Github Releases
friendly-captcha-sdk-testserver serve

# Alternative: build and run it locally
go run main.go serve

# With Docker
docker run -p 1090:1090 friendlycaptcha/sdk-testserver:latest

This starts the SDK test server on port 1090.

Next, run the tests that talk to this test server in the SDK implementation.

Command-line options

You can pass some optional settings:

  • --port 1234 run the server on a custom port.
  • --tests some/path/my_test_cases_file.json serve the test cases in a custom fixtures file.

Adding new sdk tests

The expected behavior of the SDK is defined in the test_cases.json file.

Development

Minting a release

Releases are built using Github Actions. To mint a local release, install goreleaser and run

goreleaser --snapshot --skip=publish --clean

Publishing to docker

docker login
docker buildx create --use
docker buildx build --platform=linux/amd64,linux/arm64 -t friendlycaptcha/sdk-testserver:latest . --push

FAQs

Package last updated on 21 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts