Auth Identify Resource and Access Controller
// TODO
Get clientID and Secret Key each applications.
- Twitter
- Permissions > Access permission > check "Read-only"
- Permissions > Additional permissions > check on "Request email address from users"
- GitHub
- User authorization callback URL > "http://localhost:8000/github/callback"
- User permissions > check on "User permissions" Access Read-only
- Where can this GitHub App be installed? > Any account
Create Keys
- ssh-keygen -t rsa
- example) file name is
demo
- ssh-keygen -f demo.rsa.pub -e -m pkcs8 > demo.rsa.pub.pkcs8
Set environment variables.
# Google Client ID
set GOOGLE_CLIENT_ID=<Your Client ID>
set GOOGLE_CLIENT_SECRET=<Your Client Secret>
# Twitter Consumer API keys
set TWITTER_CONSUMER_KEY=<Your Consumer Key>
set TWITTER_CONSUMER_SECRET=<Your Consumer Secret>
# Facebook
set FACEBOOK_CLIENT_ID=<Your Client ID>
set FACEBOOK_CLIENT_SECRET=<Your Client Secret>
# GitHub
set GITHUB_CLIENT_ID=<Your Client ID>
set GITHUB_CLIENT_SECRET=<Your Client Secret>
# PublicKey & SecretKey
set PRIVATE_KEY_PATH=<path>
set PUBLIC_KEY_PATH=<path>
# Optional(default 8000)
set PORT=8000
TODO
- go 1.12+
- git clone http://github.com/laqiiz/airac
- cd airac
- go mod download
- go run main.go
- curl http://localhost:8080/health
- confirming return
ok
# Windows
cd airac
copy /Y .\.githooks\*.* .\.git\hooks
# Mac/Linux
cd airac
cp .githooks/* .git/hooks
chmod +x .git/hooks/pre-commit
Binary for Linux
# on Linux
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags '-s -w' -a -installsuffix cgo -o main main.go
# on Windows
set GOOS=linux
set GOARCH=amd64
set CGO_ENABLED=0
go build -ldflags "-s -w" -a -installsuffix cgo -o main main.go
Docker
docker build -t airac .
docker run airac
- Install
go get github.com/pilu/fresh
go mod tidy
- Run
fresh
instead of go run main.go
This project is licensed under the Apache License 2.0 License - see the LICENSE file for details