Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved OAuth2l Client Interface #70

Merged
merged 9 commits into from
Aug 5, 2019
Prev Previous commit
Next Next commit
Removed July 2019 Update notes from Readme.
-Will put updates into release notes for official release.
-Minor formatting changes
  • Loading branch information
andyrzhao committed Aug 5, 2019
commit 4048f211a567c4b446192db6b479433a552b2d2e
19 changes: 1 addition & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,7 @@ working with
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.

## July 2019 Update

The `oauth2l` client has been redesigned to support a richer set of
command-line options. Options such as "scope", "audience", and "email" can
now be specified explicitly in order to avoid ambiguity and mis-use.
Furthermore, several options have been deprecated and/or renamed for clarity:

* `--json` is now `--credentials`
* `--credentials_format` is now `--output_format`
* `--jwt` is now `--type jwt`
* `--sso` is now `--type sso`

Note: The tool maintains backward compatibility with the old option names
and continues to accept implicit options for "scope", "audience", and
"email" based on context. However, please use the new style of explicit
options going forth. Refer to the "Command Options" section for details.

## Previous Version (Before Sept 2018)
## Previous Version

The previous version of `oauth2l` was written in Python and it is located
at the [python](/python) directory. The Python version is deprecated because
Expand Down
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright 2018 Google Inc.
// Copyright 2019 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -261,7 +261,7 @@ func main() {
audience := commonOpts.Audience
email := commonOpts.Email
ssocli := commonOpts.SsoCli
setCacheLocation (commonOpts.Cache)
setCacheLocation(commonOpts.Cache)
format := getOutputFormatWithFallback(opts.Fetch)
curlcli := opts.Curl.CurlCli
url := opts.Curl.Url
Expand Down Expand Up @@ -371,7 +371,7 @@ func main() {

task(token)
} else if cmd == "reset" {
setCacheLocation (opts.Reset.Cache)
setCacheLocation(opts.Reset.Cache)
util.Reset()
}
}
4 changes: 2 additions & 2 deletions util/curl.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright 2018 Google Inc.
// Copyright 2019 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -29,7 +29,7 @@ func CurlCommand(cli string, header string, url string, extraArgs ...string) {
if cli == "" {
cli = defaultCurlCli
}
requiredArgs := [] string{"-H", header, url}
requiredArgs := []string{"-H", header, url}
cmdArgs := append(requiredArgs, extraArgs...)

cmd := exec.Command(cli, cmdArgs...)
Expand Down