Skip to content

Commit

Permalink
Fix import paths in the authenticator code.
Browse files Browse the repository at this point in the history
  • Loading branch information
shinfan committed Aug 10, 2018
1 parent 51feab1 commit c5873cb
Show file tree
Hide file tree
Showing 14 changed files with 19 additions and 20 deletions.
10 changes: 5 additions & 5 deletions go/sgauth/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ To use the authenticator library in your application simply import the package i
code:

```go
import "github.com/shinfan/sgauth"
import "github.com/google/oauth2l/go/sgauth"
```

To use the authenticator to call Google APIs, simply create a authenticator settings object with
the credentials supported by Google APIs, and use the settings to create the client.
For example, to call Google API with HTTP and API key:

```go
import "github.com/shinfan/sgauth"
import "github.com/google/oauth2l/go/sgauth"

// Create the settings with pasted API key.
settings := &sgauth.Settings{
Expand Down Expand Up @@ -74,7 +74,7 @@ __REST, gRPC, ProtoRPC__

To use the library calling __REST APIs__, simply create a HTTP client:
```go
import "github.com/shinfan/sgauth"
import "github.com/google/oauth2l/go/sgauth"

// Create the settings
settings := &sgauth.Settings{
Expand All @@ -90,7 +90,7 @@ if err != nil {
Or you can use the library with a __gRPC API client__:

```go
import "github.com/shinfan/sgauth"
import "github.com/google/oauth2l/go/sgauth"

// Create the settings
settings := &sgauth.Settings{
Expand All @@ -106,7 +106,7 @@ client := library.NewLibraryServiceClient(conn)

To use the library calling __ProtoRPC APIs__:
```go
import "github.com/shinfan/sgauth"
import "github.com/google/oauth2l/go/sgauth"
import "github.com/wora/protorpc/client"

// Create the settings
Expand Down
2 changes: 1 addition & 1 deletion go/sgauth/appengine.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"time"

"golang.org/x/net/context"
"github.com/shinfan/sgauth/internal"
"github.com/google/oauth2l/go/sgauth/internal"
)

// appengineFlex is set at init time by appengineflex_hook.go. If true, we are on App Engine Flex.
Expand Down
2 changes: 1 addition & 1 deletion go/sgauth/compute.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"strings"
"fmt"
"time"
"github.com/shinfan/sgauth/internal"
"github.com/google/oauth2l/go/sgauth/internal"
)

// ComputeTokenSource returns a token source that fetches access tokens
Expand Down
2 changes: 1 addition & 1 deletion go/sgauth/credentials/credentials.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// limitations under the License.
package credentials

import "github.com/shinfan/sgauth/internal"
import "github.com/google/oauth2l/go/sgauth/internal"

// Credentials holds Google credentials, including "Application Default Credentials".
// For more details, see:
Expand Down
2 changes: 1 addition & 1 deletion go/sgauth/credentials/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ package credentials

import (
"fmt"
"github.com/shinfan/sgauth/internal"
"golang.org/x/net/context"
"github.com/google/oauth2l/go/sgauth/internal"
)

// DefaultTokenURL is Google's OAuth 2.0 token URL to use with the JWT flow.
Expand Down
3 changes: 1 addition & 2 deletions go/sgauth/credentials/jwt.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
"crypto/x509"
"errors"
"context"
"github.com/shinfan/sgauth/internal"
"github.com/google/oauth2l/go/sgauth/internal"
)

var (
Expand Down Expand Up @@ -110,7 +110,6 @@ func (js jwtSource) Token() (*internal.Token, error) {
Scope: strings.Join(js.conf.Scopes, " "),
Aud: js.conf.TokenURL,
}
fmt.Println("Token URL: " + js.conf.TokenURL)
if subject := js.conf.Subject; subject != "" {
claimSet.Sub = subject
// prn is the old name of sub. Keep setting it
Expand Down
2 changes: 1 addition & 1 deletion go/sgauth/credentials/jwt_token.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (

"golang.org/x/oauth2/jws"
"encoding/json"
"github.com/shinfan/sgauth/internal"
"github.com/google/oauth2l/go/sgauth/internal"
"encoding/pem"
"crypto/x509"
"errors"
Expand Down
4 changes: 2 additions & 2 deletions go/sgauth/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ package sgauth
import (
gRPCCredentials "google.golang.org/grpc/credentials"
"context"
"github.com/shinfan/sgauth/internal"
"os"
"fmt"
"io/ioutil"
"encoding/json"
"strings"
"github.com/shinfan/sgauth/credentials"
"cloud.google.com/go/compute/metadata"
"runtime"
"path/filepath"
"os/user"
"github.com/google/oauth2l/go/sgauth/internal"
"github.com/google/oauth2l/go/sgauth/credentials"
)

// DefaultTokenSource returns the token source for
Expand Down
2 changes: 1 addition & 1 deletion go/sgauth/example/library/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Google Authenticator(GA) Prototype

To install the Google Authenticator prototype, run:
```
go get github.com/shinfan/sgauth/example/library
go get github.com/google/oauth2l/go/sgauth/example/library
```
## Credentials
Currently Google Authenticator reads the service account JSON credential file from environment path:
Expand Down
2 changes: 1 addition & 1 deletion go/sgauth/example/library/example.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"github.com/wora/protorpc/client"
"fmt"
"google.golang.org/genproto/googleapis/example/library/v1"
"github.com/shinfan/sgauth"
"github.com/google/oauth2l/go/sgauth"
"github.com/golang/protobuf/proto"
"golang.org/x/net/context"
)
Expand Down
2 changes: 1 addition & 1 deletion go/sgauth/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"google.golang.org/grpc/credentials"

"fmt"
"github.com/shinfan/sgauth/internal"
"github.com/google/oauth2l/go/sgauth/internal"
)

func NewGrpcConn(ctx context.Context, settings *Settings, host string, port string) (*grpc.ClientConn, error) {
Expand Down
2 changes: 1 addition & 1 deletion go/sgauth/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
package sgauth

import (
"github.com/shinfan/sgauth/internal"
"github.com/google/oauth2l/go/sgauth/internal"
"net/http"
"golang.org/x/net/context"
)
Expand Down
2 changes: 1 addition & 1 deletion go/sgauth/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
package sgauth

import (
"github.com/shinfan/sgauth/internal"
"github.com/google/oauth2l/go/sgauth/internal"
"golang.org/x/net/context"
)

Expand Down
2 changes: 1 addition & 1 deletion go/sgauth/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"io"
"net/http"
"sync"
"github.com/shinfan/sgauth/internal"
"github.com/google/oauth2l/go/sgauth/internal"
)

// Transport is an http.RoundTripper that makes OAuth 2.0 HTTP requests,
Expand Down

0 comments on commit c5873cb

Please sign in to comment.