diff --git a/.gitignore b/.gitignore index f9c7b2d..ddb5d86 100644 --- a/.gitignore +++ b/.gitignore @@ -19,4 +19,4 @@ htmlcov/ reduced.pylintrc # GoLand -go/.idea/ +.idea/ diff --git a/README.md b/README.md index 7ef5e33..4e3ca88 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,20 @@ oauth2l ------- -[![Build Status](https://travis-ci.org/google/oauth2l.svg?branch=master)](https://travis-ci.org/google/oauth2l) -[![Coverage](https://coveralls.io/repos/google/oauth2l/badge.svg?branch=master)](https://coveralls.io/r/google/oauth2l?branch=master) -[![PyPI](https://img.shields.io/pypi/v/google-oauth2l.svg)](https://pypi.python.org/pypi/google-oauth2l) -[![Versions](https://img.shields.io/pypi/pyversions/google-oauth2l.svg)](https://pypi.python.org/pypi/google-oauth2l) - `oauth2l` (pronounced "oauth tool") is a simple command-line tool for working with -[Google OAuth 2.0](https://developers.google.com/identity/protocols/OAuth2). +[Google OAuth 2.0](https://developers.google.com/identity/protocols/OAuth2) +written in Go. Its primary use is to fetch and print OAuth 2.0 access tokens, which can be used with other command-line tools and shell scripts. -This tool also demonstrates how to design a simple and easy-to-use OAuth -2.0 client experience. If you need to reimplement this functionality in -another programming language, please use [Go OAuth2l](go/oauth2client) -as reference code. +## Previous Version + +The previous version of oauth2l is written in Python and it is located at the +[python](/python) directory. The Python version is deprecated and please +switch to use the Go version instead. + ## Overview @@ -39,24 +37,31 @@ accounts and service accounts in different environments: * When running with command option `--sso {email}`, it invokes an external `sso` command to retrieve Single Sign-on (SSO) access token. -NOTE: `oauth2l` caches the OAuth credentials in user's home directory to -avoid prompting user repeatedly. +## Quickstart -## Install +You will need to meet the following requirement to use this tool: + +__Minimum requirements:__ +- The tool is only available for _Linux_ or _Mac_ +- _Go 1.10.3_ or higher + +__Nice to have:__ +- Add your _$GOPATH/bin_ into your _$PATH_ ([instuctions]( +https://github.com/golang/go/wiki/GOPATH)) -``` -# Mac only. Install `pip` first. -$ sudo easy_install pip -# Install `oauth2l` under the OS, typically "/usr/local/bin". -$ pip install google-oauth2l --upgrade +```bash +# Get the package from Github +$ go get github.com/google/oauth2l/go/oauth2l -# If you see an error on OS X El Capitan or up, please try -$ pip install google-oauth2l --upgrade --ignore-installed +# Install the package into your $GOPATH/bin/ +$ go install github.com/google/oauth2l/go/oauth2l -# Install `oauth2l` under the current user, typically "~/.local/bin" (on Linux) -# and "~/Library/Python/2.7/bin" (on Mac). -$ pip install --user google-oauth2l +# Fetch the access token from your credentials with cloud-platform scope +$ ~/go/bin/oauth2l fetch --json ~/your_credentials.json cloud-platform + +# Or you can run if you $GOPATH/bin is already in your $PATH +$ oauth2l fetch --json ~/your_credentials.json cloud-platform ``` ## Command Options @@ -67,7 +72,7 @@ Specifies an OAuth credential file, either an OAuth client ID or a Service Account key, to start the OAuth flow. You can download the file from [Google Cloud Console](https://console.cloud.google.com/apis/credentials). -``` +```bash $ oauth2l fetch --json ~/service_account.json cloud-platform ``` @@ -77,13 +82,13 @@ Using an external Single Sign-on (SSO) command to fetch OAuth token. The command outputs an OAuth access token to its stdout. The default command is for Google's corporate SSO. For example: -``` +```bash $ sso me@example.com scope1 scope2 ``` Then use oauth2l with the SSO CLI: -``` +```bash $ oauth2l header --sso me@example.com --sso_cli /usr/bin/sso cloud-platform $ oauth2l header --sso me@google.com cloud-platform ``` @@ -98,7 +103,7 @@ audience [here](https://developers.google.com/identity/protocols/OAuth2ServiceAc Example: -``` +```bash oauth2l fetch --jwt --json ~/service_account.json https://pubsub.googleapis.com/google.pubsub.v1.Publisher ``` @@ -112,27 +117,16 @@ the following command prints access token for the following OAuth2 scopes: * https://www.googleapis.com/auth/userinfo.email * https://www.googleapis.com/auth/cloud-platform -``` +```bash $ oauth2l fetch userinfo.email cloud-platform ya29.zyxwvutsrqpnmolkjihgfedcba - -$ oauth2l fetch -f json userinfo.email cloud-platform -{ - "access_token": "ya29.zyxwvutsrqpnmolkjihgfedcba", - "token_expiry": "2017-02-27T21:20:47Z", - "user_agent": "oauth2l/1.0.0", - ... -} ``` -NOTE: the `-f` flag specifies the output format. The supported formats are: -bare (default), header, json, json_compact, pretty. - ### header The same as `fetch`, except the output is in HTTP header format: -``` +```bash $ oauth2l header userinfo.email Authorization: Bearer ya29.zyxwvutsrqpnmolkjihgfedcba ``` @@ -140,14 +134,14 @@ Authorization: Bearer ya29.zyxwvutsrqpnmolkjihgfedcba The `header` command is designed to be easy to use with `curl`. For example, the following command uses the PubSub API to list all PubSub topics. -``` +```bash $ curl -H "$(oauth2l header pubsub)" https://pubsub.googleapis.com/v1/projects/my-project-id/topics ``` If you need to call Google APIs frequently using `curl`, you can define a shell alias for it. For example: -``` +```bash $ alias gcurl='curl -H "$(oauth2l header cloud-platform)" -H "Content-Type: application/json" ' $ gcurl 'https://pubsub.googleapis.com/v1/projects/my-project-id/topics' ``` @@ -160,7 +154,7 @@ and expiration time. If the token has either the `https://www.googleapis.com/auth/plus.me` scope, it also prints the email address of the authenticated identity. -``` +```bash $ oauth2l info $(oauth2l fetch pubsub) { "expires_in": 3599, @@ -175,7 +169,7 @@ $ oauth2l info $(oauth2l fetch pubsub) Test a token. This sets an exit code of 0 for a valid token and 1 otherwise, which can be useful in shell pipelines. -``` +```bash $ oauth2l test ya29.zyxwvutsrqpnmolkjihgfedcba $ echo $? 0 @@ -189,6 +183,6 @@ $ echo $? Reset all tokens cached locally. We cache previously retrieved tokens in the file `~/.oauth2l.token`. -``` +```bash $ oauth2l reset ``` diff --git a/go/oauth2l/main.go b/main.go similarity index 98% rename from go/oauth2l/main.go rename to main.go index e13bda8..c19a10d 100644 --- a/go/oauth2l/main.go +++ b/main.go @@ -19,8 +19,8 @@ import ( "fmt" "io/ioutil" "strings" - "github.com/google/oauth2l/go/sgauth" - "github.com/google/oauth2l/go/oauth2l/util" + "github.com/google/oauth2l/sgauth" + "github.com/google/oauth2l/util" "os" ) diff --git a/MANIFEST.in b/python/MANIFEST.in similarity index 100% rename from MANIFEST.in rename to python/MANIFEST.in diff --git a/go/oauth2l/README.md b/python/README.md similarity index 72% rename from go/oauth2l/README.md rename to python/README.md index 1391ce0..7ef5e33 100644 --- a/go/oauth2l/README.md +++ b/python/README.md @@ -1,14 +1,23 @@ oauth2l ------- +[![Build Status](https://travis-ci.org/google/oauth2l.svg?branch=master)](https://travis-ci.org/google/oauth2l) +[![Coverage](https://coveralls.io/repos/google/oauth2l/badge.svg?branch=master)](https://coveralls.io/r/google/oauth2l?branch=master) +[![PyPI](https://img.shields.io/pypi/v/google-oauth2l.svg)](https://pypi.python.org/pypi/google-oauth2l) +[![Versions](https://img.shields.io/pypi/pyversions/google-oauth2l.svg)](https://pypi.python.org/pypi/google-oauth2l) + `oauth2l` (pronounced "oauth tool") is a simple command-line tool for working with -[Google OAuth 2.0](https://developers.google.com/identity/protocols/OAuth2) -written in Go. +[Google OAuth 2.0](https://developers.google.com/identity/protocols/OAuth2). Its primary use is to fetch and print OAuth 2.0 access tokens, which can be used with other command-line tools and shell scripts. +This tool also demonstrates how to design a simple and easy-to-use OAuth +2.0 client experience. If you need to reimplement this functionality in +another programming language, please use [Go OAuth2l](go/oauth2client) +as reference code. + ## Overview `oauth2l` supports all Google OAuth 2.0 authentication flows for both user @@ -30,31 +39,24 @@ accounts and service accounts in different environments: * When running with command option `--sso {email}`, it invokes an external `sso` command to retrieve Single Sign-on (SSO) access token. -## Quickstart - -You will need to meet the following requirement to use this tool: +NOTE: `oauth2l` caches the OAuth credentials in user's home directory to +avoid prompting user repeatedly. -__Minimum requirements:__ -- The tool is only available for _Linux_ or _Mac_ -- _Go 1.10.3_ or higher +## Install -__Nice to have:__ -- Add your _$GOPATH/bin_ into your _$PATH_ ([instuctions]( -https://github.com/golang/go/wiki/GOPATH)) - - -```bash -# Get the package from Github -$ go get github.com/google/oauth2l/go/oauth2l +``` +# Mac only. Install `pip` first. +$ sudo easy_install pip -# Install the package into your $GOPATH/bin/ -$ go install github.com/google/oauth2l/go/oauth2l +# Install `oauth2l` under the OS, typically "/usr/local/bin". +$ pip install google-oauth2l --upgrade -# Fetch the access token from your credentials with cloud-platform scope -$ ~/go/bin/oauth2l fetch --json ~/your_credentials.json cloud-platform +# If you see an error on OS X El Capitan or up, please try +$ pip install google-oauth2l --upgrade --ignore-installed -# Or you can run if you $GOPATH/bin is already in your $PATH -$ oauth2l fetch --json ~/your_credentials.json cloud-platform +# Install `oauth2l` under the current user, typically "~/.local/bin" (on Linux) +# and "~/Library/Python/2.7/bin" (on Mac). +$ pip install --user google-oauth2l ``` ## Command Options @@ -65,7 +67,7 @@ Specifies an OAuth credential file, either an OAuth client ID or a Service Account key, to start the OAuth flow. You can download the file from [Google Cloud Console](https://console.cloud.google.com/apis/credentials). -```bash +``` $ oauth2l fetch --json ~/service_account.json cloud-platform ``` @@ -75,13 +77,13 @@ Using an external Single Sign-on (SSO) command to fetch OAuth token. The command outputs an OAuth access token to its stdout. The default command is for Google's corporate SSO. For example: -```bash +``` $ sso me@example.com scope1 scope2 ``` Then use oauth2l with the SSO CLI: -```bash +``` $ oauth2l header --sso me@example.com --sso_cli /usr/bin/sso cloud-platform $ oauth2l header --sso me@google.com cloud-platform ``` @@ -96,7 +98,7 @@ audience [here](https://developers.google.com/identity/protocols/OAuth2ServiceAc Example: -```bash +``` oauth2l fetch --jwt --json ~/service_account.json https://pubsub.googleapis.com/google.pubsub.v1.Publisher ``` @@ -110,16 +112,27 @@ the following command prints access token for the following OAuth2 scopes: * https://www.googleapis.com/auth/userinfo.email * https://www.googleapis.com/auth/cloud-platform -```bash +``` $ oauth2l fetch userinfo.email cloud-platform ya29.zyxwvutsrqpnmolkjihgfedcba + +$ oauth2l fetch -f json userinfo.email cloud-platform +{ + "access_token": "ya29.zyxwvutsrqpnmolkjihgfedcba", + "token_expiry": "2017-02-27T21:20:47Z", + "user_agent": "oauth2l/1.0.0", + ... +} ``` +NOTE: the `-f` flag specifies the output format. The supported formats are: +bare (default), header, json, json_compact, pretty. + ### header The same as `fetch`, except the output is in HTTP header format: -```bash +``` $ oauth2l header userinfo.email Authorization: Bearer ya29.zyxwvutsrqpnmolkjihgfedcba ``` @@ -127,14 +140,14 @@ Authorization: Bearer ya29.zyxwvutsrqpnmolkjihgfedcba The `header` command is designed to be easy to use with `curl`. For example, the following command uses the PubSub API to list all PubSub topics. -```bash +``` $ curl -H "$(oauth2l header pubsub)" https://pubsub.googleapis.com/v1/projects/my-project-id/topics ``` If you need to call Google APIs frequently using `curl`, you can define a shell alias for it. For example: -```bash +``` $ alias gcurl='curl -H "$(oauth2l header cloud-platform)" -H "Content-Type: application/json" ' $ gcurl 'https://pubsub.googleapis.com/v1/projects/my-project-id/topics' ``` @@ -147,7 +160,7 @@ and expiration time. If the token has either the `https://www.googleapis.com/auth/plus.me` scope, it also prints the email address of the authenticated identity. -```bash +``` $ oauth2l info $(oauth2l fetch pubsub) { "expires_in": 3599, @@ -162,7 +175,7 @@ $ oauth2l info $(oauth2l fetch pubsub) Test a token. This sets an exit code of 0 for a valid token and 1 otherwise, which can be useful in shell pipelines. -```bash +``` $ oauth2l test ya29.zyxwvutsrqpnmolkjihgfedcba $ echo $? 0 @@ -176,6 +189,6 @@ $ echo $? Reset all tokens cached locally. We cache previously retrieved tokens in the file `~/.oauth2l.token`. -```bash +``` $ oauth2l reset ``` diff --git a/oauth2l/__init__.py b/python/oauth2l/__init__.py similarity index 100% rename from oauth2l/__init__.py rename to python/oauth2l/__init__.py diff --git a/oauth2l/oauth2l_test.py b/python/oauth2l/oauth2l_test.py similarity index 100% rename from oauth2l/oauth2l_test.py rename to python/oauth2l/oauth2l_test.py diff --git a/oauth2l/testdata/fake_client_secrets.json b/python/oauth2l/testdata/fake_client_secrets.json similarity index 100% rename from oauth2l/testdata/fake_client_secrets.json rename to python/oauth2l/testdata/fake_client_secrets.json diff --git a/oauth2l/testdata/fake_service_account.json b/python/oauth2l/testdata/fake_service_account.json similarity index 100% rename from oauth2l/testdata/fake_service_account.json rename to python/oauth2l/testdata/fake_service_account.json diff --git a/oauth2l/testdata/noninstalled_client_secrets.json b/python/oauth2l/testdata/noninstalled_client_secrets.json similarity index 100% rename from oauth2l/testdata/noninstalled_client_secrets.json rename to python/oauth2l/testdata/noninstalled_client_secrets.json diff --git a/setup.cfg b/python/setup.cfg similarity index 100% rename from setup.cfg rename to python/setup.cfg diff --git a/setup.py b/python/setup.py similarity index 100% rename from setup.py rename to python/setup.py diff --git a/tox.ini b/python/tox.ini similarity index 100% rename from tox.ini rename to python/tox.ini diff --git a/go/sgauth/README.md b/sgauth/README.md similarity index 94% rename from go/sgauth/README.md rename to sgauth/README.md index 7c09bbe..0107296 100644 --- a/go/sgauth/README.md +++ b/sgauth/README.md @@ -28,7 +28,7 @@ To use the authenticator library in your application simply import the package i code: ```go -import "github.com/google/oauth2l/go/sgauth" +import "github.com/google/oauth2l/sgauth" ``` To use the authenticator to call Google APIs, simply create a authenticator settings object with @@ -36,7 +36,7 @@ the credentials supported by Google APIs, and use the settings to create the cli For example, to call Google API with HTTP and API key: ```go -import "github.com/google/oauth2l/go/sgauth" +import "github.com/google/oauth2l/sgauth" // Create the settings with pasted API key. settings := &sgauth.Settings{ @@ -78,7 +78,7 @@ __REST, gRPC, ProtoRPC__ To use the library calling __REST APIs__, simply create a HTTP client: ```go -import "github.com/google/oauth2l/go/sgauth" +import "github.com/google/oauth2l/sgauth" // Create the settings settings := &sgauth.Settings{ @@ -94,7 +94,7 @@ if err != nil { Or you can use the library with a __gRPC API client__: ```go -import "github.com/google/oauth2l/go/sgauth" +import "github.com/google/oauth2l/sgauth" // Create the settings settings := &sgauth.Settings{ @@ -110,7 +110,7 @@ client := library.NewLibraryServiceClient(conn) To use the library calling __ProtoRPC APIs__: ```go -import "github.com/google/oauth2l/go/sgauth" +import "github.com/google/oauth2l/sgauth" import "github.com/wora/protorpc/client" // Create the settings diff --git a/go/sgauth/appengine.go b/sgauth/appengine.go similarity index 98% rename from go/sgauth/appengine.go rename to sgauth/appengine.go index f616a73..52a36dd 100644 --- a/go/sgauth/appengine.go +++ b/sgauth/appengine.go @@ -21,7 +21,7 @@ import ( "time" "golang.org/x/net/context" - "github.com/google/oauth2l/go/sgauth/internal" + "github.com/google/oauth2l/sgauth/internal" ) // appengineFlex is set at init time by appengineflex_hook.go. If true, we are on App Engine Flex. diff --git a/go/sgauth/appengine_hook.go b/sgauth/appengine_hook.go similarity index 100% rename from go/sgauth/appengine_hook.go rename to sgauth/appengine_hook.go diff --git a/go/sgauth/compute.go b/sgauth/compute.go similarity index 97% rename from go/sgauth/compute.go rename to sgauth/compute.go index 20e7e54..6f2a768 100644 --- a/go/sgauth/compute.go +++ b/sgauth/compute.go @@ -21,7 +21,7 @@ import ( "strings" "fmt" "time" - "github.com/google/oauth2l/go/sgauth/internal" + "github.com/google/oauth2l/sgauth/internal" ) // ComputeTokenSource returns a token source that fetches access tokens diff --git a/go/sgauth/credentials/credentials.go b/sgauth/credentials/credentials.go similarity index 95% rename from go/sgauth/credentials/credentials.go rename to sgauth/credentials/credentials.go index adc9758..51abee8 100644 --- a/go/sgauth/credentials/credentials.go +++ b/sgauth/credentials/credentials.go @@ -14,7 +14,7 @@ // limitations under the License. package credentials -import "github.com/google/oauth2l/go/sgauth/internal" +import "github.com/google/oauth2l/sgauth/internal" // Credentials holds Google credentials, including "Application Default Credentials". // For more details, see: diff --git a/go/sgauth/credentials/file.go b/sgauth/credentials/file.go similarity index 98% rename from go/sgauth/credentials/file.go rename to sgauth/credentials/file.go index 2ebdef4..a49144a 100644 --- a/go/sgauth/credentials/file.go +++ b/sgauth/credentials/file.go @@ -17,7 +17,7 @@ package credentials import ( "fmt" "golang.org/x/net/context" - "github.com/google/oauth2l/go/sgauth/internal" + "github.com/google/oauth2l/sgauth/internal" ) // DefaultTokenURL is Google's OAuth 2.0 token URL to use with the service diff --git a/go/sgauth/credentials/jwt.go b/sgauth/credentials/jwt.go similarity index 99% rename from go/sgauth/credentials/jwt.go rename to sgauth/credentials/jwt.go index fe53de2..794a1ee 100644 --- a/go/sgauth/credentials/jwt.go +++ b/sgauth/credentials/jwt.go @@ -29,7 +29,7 @@ import ( "crypto/x509" "errors" "context" - "github.com/google/oauth2l/go/sgauth/internal" + "github.com/google/oauth2l/sgauth/internal" ) var ( diff --git a/go/sgauth/credentials/jwt_token.go b/sgauth/credentials/jwt_token.go similarity index 98% rename from go/sgauth/credentials/jwt_token.go rename to sgauth/credentials/jwt_token.go index 114a6c6..32b4c7e 100644 --- a/go/sgauth/credentials/jwt_token.go +++ b/sgauth/credentials/jwt_token.go @@ -21,7 +21,7 @@ import ( "golang.org/x/oauth2/jws" "encoding/json" - "github.com/google/oauth2l/go/sgauth/internal" + "github.com/google/oauth2l/sgauth/internal" "encoding/pem" "crypto/x509" "errors" diff --git a/go/sgauth/default.go b/sgauth/default.go similarity index 97% rename from go/sgauth/default.go rename to sgauth/default.go index 47a2ce6..f582061 100644 --- a/go/sgauth/default.go +++ b/sgauth/default.go @@ -25,8 +25,8 @@ import ( "runtime" "path/filepath" "os/user" - "github.com/google/oauth2l/go/sgauth/internal" - "github.com/google/oauth2l/go/sgauth/credentials" + "github.com/google/oauth2l/sgauth/internal" + "github.com/google/oauth2l/sgauth/credentials" ) // DefaultTokenSource returns the token source for diff --git a/go/sgauth/example/library/README.md b/sgauth/example/library/README.md similarity index 98% rename from go/sgauth/example/library/README.md rename to sgauth/example/library/README.md index a5b0e63..9ad9e87 100644 --- a/go/sgauth/example/library/README.md +++ b/sgauth/example/library/README.md @@ -4,7 +4,7 @@ Google Authenticator(GA) Prototype To install the Google Authenticator prototype, run: ``` -go get github.com/google/oauth2l/go/sgauth/example/library +go get github.com/google/oauth2l/sgauth/example/library ``` ## Credentials Currently Google Authenticator reads the service account JSON credential file from environment path: diff --git a/go/sgauth/example/library/example.go b/sgauth/example/library/example.go similarity index 98% rename from go/sgauth/example/library/example.go rename to sgauth/example/library/example.go index ab8dea9..a064f81 100644 --- a/go/sgauth/example/library/example.go +++ b/sgauth/example/library/example.go @@ -18,7 +18,7 @@ import ( "github.com/wora/protorpc/client" "fmt" "google.golang.org/genproto/googleapis/example/library/v1" - "github.com/google/oauth2l/go/sgauth" + "github.com/google/oauth2l/sgauth" "github.com/golang/protobuf/proto" "golang.org/x/net/context" ) diff --git a/go/sgauth/example/library/main.go b/sgauth/example/library/main.go similarity index 100% rename from go/sgauth/example/library/main.go rename to sgauth/example/library/main.go diff --git a/go/sgauth/example/library/utils.go b/sgauth/example/library/utils.go similarity index 100% rename from go/sgauth/example/library/utils.go rename to sgauth/example/library/utils.go diff --git a/go/sgauth/grpc.go b/sgauth/grpc.go similarity index 96% rename from go/sgauth/grpc.go rename to sgauth/grpc.go index 22c6335..20d8907 100644 --- a/go/sgauth/grpc.go +++ b/sgauth/grpc.go @@ -21,7 +21,7 @@ import ( "google.golang.org/grpc/credentials" "fmt" - "github.com/google/oauth2l/go/sgauth/internal" + "github.com/google/oauth2l/sgauth/internal" ) func NewGrpcConn(ctx context.Context, settings *Settings, host string, port string) (*grpc.ClientConn, error) { diff --git a/go/sgauth/http.go b/sgauth/http.go similarity index 96% rename from go/sgauth/http.go rename to sgauth/http.go index 8d5f534..e925744 100644 --- a/go/sgauth/http.go +++ b/sgauth/http.go @@ -15,7 +15,7 @@ package sgauth import ( - "github.com/google/oauth2l/go/sgauth/internal" + "github.com/google/oauth2l/sgauth/internal" "net/http" "golang.org/x/net/context" ) diff --git a/go/sgauth/internal/config.go b/sgauth/internal/config.go similarity index 100% rename from go/sgauth/internal/config.go rename to sgauth/internal/config.go diff --git a/go/sgauth/internal/const.go b/sgauth/internal/const.go similarity index 100% rename from go/sgauth/internal/const.go rename to sgauth/internal/const.go diff --git a/go/sgauth/internal/grpc.go b/sgauth/internal/grpc.go similarity index 100% rename from go/sgauth/internal/grpc.go rename to sgauth/internal/grpc.go diff --git a/go/sgauth/internal/http.go b/sgauth/internal/http.go similarity index 100% rename from go/sgauth/internal/http.go rename to sgauth/internal/http.go diff --git a/go/sgauth/internal/token.go b/sgauth/internal/token.go similarity index 100% rename from go/sgauth/internal/token.go rename to sgauth/internal/token.go diff --git a/go/sgauth/internal/token_retriever.go b/sgauth/internal/token_retriever.go similarity index 100% rename from go/sgauth/internal/token_retriever.go rename to sgauth/internal/token_retriever.go diff --git a/go/sgauth/settings.go b/sgauth/settings.go similarity index 100% rename from go/sgauth/settings.go rename to sgauth/settings.go diff --git a/go/sgauth/token.go b/sgauth/token.go similarity index 97% rename from go/sgauth/token.go rename to sgauth/token.go index ae9a6dd..4499909 100644 --- a/go/sgauth/token.go +++ b/sgauth/token.go @@ -15,7 +15,7 @@ package sgauth import ( - "github.com/google/oauth2l/go/sgauth/internal" + "github.com/google/oauth2l/sgauth/internal" "golang.org/x/net/context" ) diff --git a/go/oauth2l/util/cache.go b/util/cache.go similarity index 98% rename from go/oauth2l/util/cache.go rename to util/cache.go index 9d3a218..ab1a283 100644 --- a/go/oauth2l/util/cache.go +++ b/util/cache.go @@ -19,7 +19,7 @@ import ( "io/ioutil" "encoding/json" "os" - "github.com/google/oauth2l/go/sgauth" + "github.com/google/oauth2l/sgauth" "os/user" ) diff --git a/go/oauth2l/util/sso.go b/util/sso.go similarity index 100% rename from go/oauth2l/util/sso.go rename to util/sso.go diff --git a/go/oauth2l/util/tasks.go b/util/tasks.go similarity index 98% rename from go/oauth2l/util/tasks.go rename to util/tasks.go index 73084a7..26cee9e 100644 --- a/go/oauth2l/util/tasks.go +++ b/util/tasks.go @@ -19,7 +19,7 @@ import ( "net/http" "io/ioutil" "errors" - "github.com/google/oauth2l/go/sgauth" + "github.com/google/oauth2l/sgauth" "context" "encoding/json" "log"