Skip to content
No description or website provided.
Ruby TSQL Shell Makefile Dockerfile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.dependabot
ci
lib
mysql
spec
.dockerignore
.editorconfig
.gitignore
.rspec
.ruby-version
Dockerfile
Gemfile
Gemfile.lock
LICENCE
Makefile
README.md
app.rb
config.ru
docker-compose.concourse.yml
docker-compose.development.yml
docker-compose.yml

README.md

GovWifi Authentication API

This API is used by the frontend when a connection request is made to GovWifi. Its function is to check these requests against user details and the result determines how FreeRADIUS reacts to it e.g. allow / dissallow the connection.

N.B. The private GovWifi build repository contains instructions on how to build GovWifi end-to-end - the sites, services and infrastructure.

Table of Contents

Overview

GovWifi exposes FreeRADIUS servers on public IP addresses, which are configured to communicate with this private API via its REST plugin.

Sinatra routes

  • GET /authorize/user/:user_name - FreeRADIUS authorisation route

Dependencies

  • MySQL database - user details generated by the user signup API are fetched by this API.

Developing

The Makefile contains commonly used commands for working with this app:

  • make test runs all the automated tests.
  • make serve starts the API server on localhost.
  • make shell starts the API server, then opens a shell in its docker container.

Deploying changes

Merging to master will automatically deploy this API to staging. To deploy to production, choose Deploy to production in the Concourse Pipeline.

Gotchas

Extra API parameters

let(:url) { "/authorize/user/#{username}/mac/#{client_mac}/ap/#{ap_mac}/site/#{ap_ip_address}/apg/#{ap_aruba_name}/mdn/#{ap_meraki_name}" }

Currently we do not use any of the above parameters after username within any part of the API code. However having these parameters in the CloudWatch logs is useful for linking up matching requests between the /authorize and /post-auth calls while debugging.

Licence

This codebase is released under the MIT License.

You can’t perform that action at this time.