Skip to content

Test if we can use Github as a way of controlling access to internal applications

Notifications You must be signed in to change notification settings

unee-t/internal-github-login

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Upon logging in with Github, checks whether user is part of desired organisation before setting secure cookie.

https://github.com/organizations/unee-t/settings/applications/978656

How to use

import login "github.com/unee-t/internal-github-login"

func BasicEngine() http.Handler {
	adminHandlers := alice.New(login.RequireUneeT)
	app := login.GithubOrgOnly() // sets up special routes like GH callback
	app.Handle("/", adminHandlers.ThenFunc(indexHandler))
	return app
}

func indexHandler(w http.ResponseWriter, req *http.Request) {
	fmt.Fprintf(w, "For Unee-T eyes only")
}

About

Test if we can use Github as a way of controlling access to internal applications

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published