This directory contains examples of auth configurations that may be used as a reference for setting up auth for a bundle server.
Warning
The examples contained within this directory should not be used directly in a production context due to publicly-visible (in this repo) credentials.
The file config/fixed.json configures Basic
authentication with username "admin" and password "bundle_server".
The example plugin implemented in _plugins/simple-plugin.go
can be built (from this directory) with:
go build -buildmode=plugin -o ./plugins/ ./_plugins/simple-plugin.gowhich will create simple-plugin.so - this is your plugin file.
To use this plugin with git-bundle-web-server, the config in
config/plugin.json needs to be updated with the SHA256
checksum of the plugin. This value can be determined by running (from this
directory):
shasum -a 256 ./_plugins/simple-plugin.soThe configured simple-plugin.so auth middleware implements Basic
authentication with a hardcoded username "admin" and a password that is based on
the requested route (if the requested route is test/repo or
test/repo/bundle-123456.bundle, the password is "test_repo").
Note
The example
plugin.jsoncontains a relative, rather than absolute, path to the plugin file, relative to the root of this repository. This is meant to facilitate more portable testing and is not recommended for typical use; please use an absolute path to identify your plugin file.