Skip to content

Commit

Permalink
add fluent api, stop exporting SkipSSLValidation
Browse files Browse the repository at this point in the history
  • Loading branch information
joefitzgerald committed Jun 13, 2019
1 parent 716bd4d commit 513ae24
Show file tree
Hide file tree
Showing 26 changed files with 603 additions and 284 deletions.
49 changes: 46 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,56 @@
# `go-uaa` [![Travis-CI](https://travis-ci.org/cloudfoundry-community/go-uaa.svg)](https://travis-ci.org/cloudfoundry-community/go-uaa) [![GoDoc](https://godoc.org/github.com/cloudfoundry-community/go-uaa?status.svg)](http://godoc.org/github.com/cloudfoundry-community/go-uaa) [![Report card](https://goreportcard.com/badge/github.com/cloudfoundry-community/go-uaa)](https://goreportcard.com/report/github.com/cloudfoundry-community/go-uaa)
# `go-uaa` [![Travis-CI](https://travis-ci.org/cloudfoundry-community/go-uaa.svg)](https://travis-ci.org/cloudfoundry-community/go-uaa) [![godoc](https://godoc.org/github.com/cloudfoundry-community/go-uaa?status.svg)](http://godoc.org/github.com/cloudfoundry-community/go-uaa) [![Report card](https://goreportcard.com/badge/github.com/cloudfoundry-community/go-uaa)](https://goreportcard.com/report/github.com/cloudfoundry-community/go-uaa)

### Overview

`go-uaa` is a client library for the [UAA API](https://docs.cloudfoundry.org/api/uaa/).
`go-uaa` is a client library for the [UAA API](https://docs.cloudfoundry.org/api/uaa/). It is a [`go module`](https://github.com/golang/go/wiki/Modules).

### Usage

#### Step 1: Add `go-uaa` As A Dependency
```
go get -u github.com/cloudfoundry-community/go-uaa
$ go mod init # optional
$ go get -u github.com/cloudfoundry-community/go-uaa
$ cat go.mod
```

```
module github.com/cloudfoundry-community/go-uaa/cmd/test
go 1.12
require github.com/cloudfoundry-community/go-uaa latest
```

#### Step 2: Construct and Use `uaa.API`

```bash
$ cat main.go
```

```go
package main

import (
"log"

uaa "github.com/cloudfoundry-community/go-uaa"
)

func main() {
// construct the API, and validate it
api := uaa.New("https://uaa.example.net", "").WithClientCredentials("client-id", "client-secret", uaa.JSONWebToken)
err := api.Validate()
if err != nil {
log.Fatal(err)
}

// use the API to fetch a user
user, err := api.GetUserByUsername("[email protected]", "uaa", "")
if err != nil {
log.Fatal(err)
}
log.Printf("Hello, %s\n", user.Name.GivenName)
}
```

### Experimental
Expand Down
Loading

0 comments on commit 513ae24

Please sign in to comment.