wantedly/developers-account-mapper

Name: developers-account-mapper

Owner: Wantedly, Inc.

Description: Convert a username to other account usernames associated with the user.

Created: 2016-12-13 06:50:01.0

Updated: 2018-05-17 21:40:05.0

Pushed: 2018-02-06 09:00:10.0

Homepage:

Size: 91

Language: Go

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

developers-account-mapper

Build Status GitHub release

Summary

Manage developers' accounts list.

velopers-account-mapper to-slack-mention potsbo
XXXXXXX|shimpei>
Description

Convert a key username, which is recommended to be unique among the developers group, to other username. Currently, we support Slack and GitHub.

Slack

Especially about Slack, developers-account-mapper is able to fetch Slack ID by Slack username and output it as a Slack mention format.

Usage

One DynamoDB tables named DevelopersAccountMap has to be created.

DevelopersAccountMap table

|Key|Type| | |—|—-|—| |LoginName|String|Primary key|

In Terraform, you can create the table with below.

urce "aws_dynamodb_table" "developers-account-map" {
me           = "DevelopersAccountMap"
ad_capacity  = 5 # or anything you want
ite_capacity = 5 # or anything you want
sh_key       = "LoginName"
tribute {
name = "LoginName"
type = "S"


In addition, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION and SLACK_API_TOKEN must be set at your shell. This IAM user/role must be allowed to read/write the DynamoDB table above.

Command Usage
e: developers-account-mapper [--version] [--help] <command> [<args>]

lable commands are:
delete              Delete record with <login_name>
exec                Set account information as env vars and exec commands
list                List mapping of <login_name> and mapped accounts
register            Register LoginName and other accounts mapping
to-github-name      Get <github_username> from <login_name>
to-slack-mention    Get <slack_mention> from <login_name>
version             Print developers-account-mapper version and quit
Use with Docker
Run
er run --rm \
 SLACK_API_TOKEN=<slack token get by https://api.slack.com/docs/oauth-test-tokens>  \
 AWS_ACCESS_KEY_ID=yourawsaccesskeyid \
 AWS_SECRET_ACCESS_KEY=yourawssecretaccesskey \
 AWS_REGION=ap-northeast-1 \
ay.io/wantedly/developers-account-mapper \
ommand>
Install

To install, use go get:

 get -d github.com/wantedly/developers-account-mapper
Contribution
  1. Fork (https://github.com/wantedly/developers-account-mapper/fork)
  2. Create a feature branch
  3. Commit your changes
  4. Rebase your local changes against the master branch
  5. Run test suite with the go test ./... command and confirm that it passes
  6. Run gofmt -s
  7. Create a new Pull Request
Author

wantedly

License

MIT License


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.