Skip to content

Commit

Permalink
schema: remove clients API
Browse files Browse the repository at this point in the history
The only thing using this AFAIK is dexctl in api_driver mode, which
no-one uses - it's a sort of weird API which requires a client to create
other clients, and gives all clients the ability to list all other
clients. So we are removing it.
  • Loading branch information
Bobby Rullo committed Jun 15, 2016
1 parent b7e19b6 commit 104c976
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 429 deletions.
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 @@ -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 All @@ -310,8 +218,8 @@ A client with associated public metadata.
> |Name|Located in|Description|Required|Type|
|:-----|:-----|:-----|:-----|:-----|
| nextPageToken | query | | No | string |
| maxResults | query | | No | integer |
| nextPageToken | query | | No | string |


> __Responses__
Expand Down
174 changes: 0 additions & 174 deletions schema/workerschema/v1-gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ func New(client *http.Client) (*Service, error) {
return nil, errors.New("client is nil")
}
s := &Service{client: client, BasePath: basePath}
s.Clients = NewClientsService(s)
s.RefreshClient = NewRefreshClientService(s)
s.Users = NewUsersService(s)
return s, nil
Expand All @@ -55,22 +54,11 @@ type Service struct {
client *http.Client
BasePath string // API endpoint base URL

Clients *ClientsService

RefreshClient *RefreshClientService

Users *UsersService
}

func NewClientsService(s *Service) *ClientsService {
rs := &ClientsService{s: s}
return rs
}

type ClientsService struct {
s *Service
}

func NewRefreshClientService(s *Service) *RefreshClientService {
rs := &RefreshClientService{s: s}
return rs
Expand All @@ -89,26 +77,6 @@ type UsersService struct {
s *Service
}

type Client struct {
Id string `json:"id,omitempty"`

RedirectURIs []string `json:"redirectURIs,omitempty"`
}

type ClientPage struct {
Clients []*Client `json:"clients,omitempty"`

NextPageToken string `json:"nextPageToken,omitempty"`
}

type ClientWithSecret struct {
Id string `json:"id,omitempty"`

RedirectURIs []string `json:"redirectURIs,omitempty"`

Secret string `json:"secret,omitempty"`
}

type Error struct {
Error string `json:"error,omitempty"`

Expand Down Expand Up @@ -192,148 +160,6 @@ type UsersResponse struct {
Users []*User `json:"users,omitempty"`
}

// method id "dex.Client.Create":

type ClientsCreateCall struct {
s *Service
client *Client
opt_ map[string]interface{}
}

// Create: Register a new Client.
func (r *ClientsService) Create(client *Client) *ClientsCreateCall {
c := &ClientsCreateCall{s: r.s, opt_: make(map[string]interface{})}
c.client = client
return c
}

// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *ClientsCreateCall) Fields(s ...googleapi.Field) *ClientsCreateCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}

func (c *ClientsCreateCall) Do() (*ClientWithSecret, error) {
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.client)
if err != nil {
return nil, err
}
ctype := "application/json"
params := make(url.Values)
params.Set("alt", "json")
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "clients")
urls += "?" + params.Encode()
req, _ := http.NewRequest("POST", urls, body)
googleapi.SetOpaque(req.URL)
req.Header.Set("Content-Type", ctype)
req.Header.Set("User-Agent", "google-api-go-client/0.5")
res, err := c.s.client.Do(req)
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
var ret *ClientWithSecret
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Register a new Client.",
// "httpMethod": "POST",
// "id": "dex.Client.Create",
// "path": "clients",
// "request": {
// "$ref": "Client"
// },
// "response": {
// "$ref": "ClientWithSecret"
// }
// }

}

// method id "dex.Client.List":

type ClientsListCall struct {
s *Service
opt_ map[string]interface{}
}

// List: Retrieve a page of Client objects.
func (r *ClientsService) List() *ClientsListCall {
c := &ClientsListCall{s: r.s, opt_: make(map[string]interface{})}
return c
}

// NextPageToken sets the optional parameter "nextPageToken":
func (c *ClientsListCall) NextPageToken(nextPageToken string) *ClientsListCall {
c.opt_["nextPageToken"] = nextPageToken
return c
}

// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *ClientsListCall) Fields(s ...googleapi.Field) *ClientsListCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}

func (c *ClientsListCall) Do() (*ClientPage, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", "json")
if v, ok := c.opt_["nextPageToken"]; ok {
params.Set("nextPageToken", fmt.Sprintf("%v", v))
}
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "clients")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
googleapi.SetOpaque(req.URL)
req.Header.Set("User-Agent", "google-api-go-client/0.5")
res, err := c.s.client.Do(req)
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
var ret *ClientPage
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Retrieve a page of Client objects.",
// "httpMethod": "GET",
// "id": "dex.Client.List",
// "parameters": {
// "nextPageToken": {
// "location": "query",
// "type": "string"
// }
// },
// "path": "clients",
// "response": {
// "$ref": "ClientPage"
// }
// }

}

// method id "dex.RefreshClient.List":

type RefreshClientListCall struct {
Expand Down
Loading

0 comments on commit 104c976

Please sign in to comment.