Skip to content

Commit

Permalink
Merge pull request #468 from bobbyrullo/remove_apis
Browse files Browse the repository at this point in the history
Remove old client_resource api
  • Loading branch information
bobbyrullo authored Jun 15, 2016
2 parents b7e19b6 + c9c33be commit ce72146
Show file tree
Hide file tree
Showing 15 changed files with 10 additions and 1,059 deletions.
71 changes: 0 additions & 71 deletions cmd/dexctl/driver_api.go

This file was deleted.

18 changes: 1 addition & 17 deletions cmd/dexctl/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package main

import (
"errors"
"net/http"
"os"
"strings"

Expand Down Expand Up @@ -44,7 +43,6 @@ var (
}

global struct {
endpoint string
creds oidc.ClientCredentials
dbURL string
help bool
Expand All @@ -55,9 +53,6 @@ var (
func init() {
log.EnableTimestamps()

rootCmd.PersistentFlags().StringVar(&global.endpoint, "endpoint", "", "URL of dex API")
rootCmd.PersistentFlags().StringVar(&global.creds.ID, "client-id", "", "dex API user ID")
rootCmd.PersistentFlags().StringVar(&global.creds.Secret, "client-secret", "", "dex API user password")
rootCmd.PersistentFlags().StringVar(&global.dbURL, "db-url", "", "DSN-formatted database connection string")
rootCmd.PersistentFlags().BoolVar(&global.logDebug, "log-debug", false, "Log debug-level information")
}
Expand All @@ -79,19 +74,8 @@ func getDriver() (drv driver) {
switch {
case len(global.dbURL) > 0:
drv, err = newDBDriver(global.dbURL)
case len(global.endpoint) > 0:
if len(global.creds.ID) == 0 || len(global.creds.Secret) == 0 {
err = errors.New("--client-id/--client-secret flags unset")
break
}
pcfg, err := oidc.FetchProviderConfig(http.DefaultClient, global.endpoint)
if err != nil {
stderr("Unable to fetch provider config: %v", err)
os.Exit(1)
}
drv, err = newAPIDriver(pcfg, global.creds)
default:
err = errors.New("--endpoint/--db-url flags unset")
err = errors.New("--db-url flag unset")
}

if err != nil {
Expand Down
91 changes: 0 additions & 91 deletions integration/client_api_test.go

This file was deleted.

2 changes: 1 addition & 1 deletion schema/adminschema/mapper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func TestMapSchemaClientToClient(t *testing.T) {
Id: "123",
Secret: "sec_123",
RedirectURIs: []string{
"ht.d://p * * *",
"",
},
},
wantErr: true,
Expand Down
3 changes: 2 additions & 1 deletion schema/adminschema/v1-json.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package adminschema

//
// This file is automatically generated by schema/generator
//
Expand Down Expand Up @@ -236,4 +237,4 @@ const DiscoveryJSON = `{
}
}
`
`
2 changes: 2 additions & 0 deletions schema/generator
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,5 @@ GOPATH=${PWD}/gopath ./bin/google-api-go-generator \

# Finally, fix the import in the bindings to refer to the vendored google-api package
goimports -w ${GEN}

gofmt -w schema/${GOPKG}
94 changes: 1 addition & 93 deletions schema/workerschema/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,46 +8,6 @@ __Version:__ v1
## Models


### Client



```
{
id: string,
redirectURIs: [
string
]
}
```

### ClientPage



```
{
clients: [
Client
],
nextPageToken: string
}
```

### ClientWithSecret



```
{
id: string,
redirectURIs: [
string
],
secret: string
}
```

### Error


Expand Down Expand Up @@ -232,8 +192,8 @@ A client with associated public metadata.
> |Name|Located in|Description|Required|Type|
|:-----|:-----|:-----|:-----|:-----|
| clientid | path | | Yes | string |
| userid | path | | Yes | string |
| clientid | path | | Yes | string |


> __Responses__
Expand All @@ -243,58 +203,6 @@ A client with associated public metadata.
| default | Unexpected error | |


### GET /clients

> __Summary__
> List Clients
> __Description__
> Retrieve a page of Client objects.

> __Parameters__
> |Name|Located in|Description|Required|Type|
|:-----|:-----|:-----|:-----|:-----|
| nextPageToken | query | | No | string |


> __Responses__
> |Code|Description|Type|
|:-----|:-----|:-----|
| 200 | | [ClientPage](#clientpage) |
| default | Unexpected error | |


### POST /clients

> __Summary__
> Create Clients
> __Description__
> Register a new Client.

> __Parameters__
> |Name|Located in|Description|Required|Type|
|:-----|:-----|:-----|:-----|:-----|
| | body | | Yes | [Client](#client) |


> __Responses__
> |Code|Description|Type|
|:-----|:-----|:-----|
| 200 | | [ClientWithSecret](#clientwithsecret) |
| default | Unexpected error | |


### GET /users

> __Summary__
Expand Down
Loading

0 comments on commit ce72146

Please sign in to comment.