Skip to content
This repository has been archived by the owner on Mar 15, 2024. It is now read-only.
/ signing-proxy-go Public archive

Proxy that signs requests to the kiddom content service.

License

Notifications You must be signed in to change notification settings

kiddom/signing-proxy-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Signing Proxy

Proxy to sign kiddom api requests.

Usage

The proxy reads the following environment variables:

  • REMOTE_HOST is the Kiddom content api in the form of https://kiddom-content-dev.herokuapp.com.
  • PORT is the local port that the proxy will listen on.
  • K_USER_ID is the user id.
  • K_PRIVATE_KEY is the private key used to sign the requests.

Example:

$ REMOTE_HOST={api_host} PORT={local_port} K_USER_ID={user_id} K_PRIVATE_KEY={private_key/password} \
    go run main.go

or set up a .env file that will be read by the proxy

$ cat <<EOF >> .env
REMOTE_HOST="https://kiddom-content-dev.herokuapp.com"
PORT=4000
K_USER_ID=foobar
K_PRIVATE_KEY=myvoiceismypassword
EOF
$ go run main.go

Then you can pass requests directly to the proxy, which will sign them:

$ curl -sH 'Accept-encoding: identity' http://localhost:4000/content_import
[]

$ curl -X POST -sH 'Accept-encoding: identity' -F 'data=@filename.csv' http://localhost:4000/content_import

Dependencies

The proxy uses github.com/joho/godotenv to read environment variables from your .env file.

About

Proxy that signs requests to the kiddom content service.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages