forked from mystiq/dex
schema: remove clients API
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.
This commit is contained in:
parent
b7e19b6e84
commit
104c9761c6
4 changed files with 1 additions and 429 deletions
|
@ -8,46 +8,6 @@ __Version:__ v1
|
||||||
## Models
|
## Models
|
||||||
|
|
||||||
|
|
||||||
### Client
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
```
|
|
||||||
{
|
|
||||||
id: string,
|
|
||||||
redirectURIs: [
|
|
||||||
string
|
|
||||||
]
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### ClientPage
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
```
|
|
||||||
{
|
|
||||||
clients: [
|
|
||||||
Client
|
|
||||||
],
|
|
||||||
nextPageToken: string
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### ClientWithSecret
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
```
|
|
||||||
{
|
|
||||||
id: string,
|
|
||||||
redirectURIs: [
|
|
||||||
string
|
|
||||||
],
|
|
||||||
secret: string
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Error
|
### Error
|
||||||
|
|
||||||
|
|
||||||
|
@ -243,58 +203,6 @@ A client with associated public metadata.
|
||||||
| default | Unexpected error | |
|
| 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
|
### GET /users
|
||||||
|
|
||||||
> __Summary__
|
> __Summary__
|
||||||
|
@ -310,8 +218,8 @@ A client with associated public metadata.
|
||||||
|
|
||||||
> |Name|Located in|Description|Required|Type|
|
> |Name|Located in|Description|Required|Type|
|
||||||
|:-----|:-----|:-----|:-----|:-----|
|
|:-----|:-----|:-----|:-----|:-----|
|
||||||
| nextPageToken | query | | No | string |
|
|
||||||
| maxResults | query | | No | integer |
|
| maxResults | query | | No | integer |
|
||||||
|
| nextPageToken | query | | No | string |
|
||||||
|
|
||||||
|
|
||||||
> __Responses__
|
> __Responses__
|
||||||
|
|
|
@ -45,7 +45,6 @@ func New(client *http.Client) (*Service, error) {
|
||||||
return nil, errors.New("client is nil")
|
return nil, errors.New("client is nil")
|
||||||
}
|
}
|
||||||
s := &Service{client: client, BasePath: basePath}
|
s := &Service{client: client, BasePath: basePath}
|
||||||
s.Clients = NewClientsService(s)
|
|
||||||
s.RefreshClient = NewRefreshClientService(s)
|
s.RefreshClient = NewRefreshClientService(s)
|
||||||
s.Users = NewUsersService(s)
|
s.Users = NewUsersService(s)
|
||||||
return s, nil
|
return s, nil
|
||||||
|
@ -55,22 +54,11 @@ type Service struct {
|
||||||
client *http.Client
|
client *http.Client
|
||||||
BasePath string // API endpoint base URL
|
BasePath string // API endpoint base URL
|
||||||
|
|
||||||
Clients *ClientsService
|
|
||||||
|
|
||||||
RefreshClient *RefreshClientService
|
RefreshClient *RefreshClientService
|
||||||
|
|
||||||
Users *UsersService
|
Users *UsersService
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewClientsService(s *Service) *ClientsService {
|
|
||||||
rs := &ClientsService{s: s}
|
|
||||||
return rs
|
|
||||||
}
|
|
||||||
|
|
||||||
type ClientsService struct {
|
|
||||||
s *Service
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewRefreshClientService(s *Service) *RefreshClientService {
|
func NewRefreshClientService(s *Service) *RefreshClientService {
|
||||||
rs := &RefreshClientService{s: s}
|
rs := &RefreshClientService{s: s}
|
||||||
return rs
|
return rs
|
||||||
|
@ -89,26 +77,6 @@ type UsersService struct {
|
||||||
s *Service
|
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 {
|
type Error struct {
|
||||||
Error string `json:"error,omitempty"`
|
Error string `json:"error,omitempty"`
|
||||||
|
|
||||||
|
@ -192,148 +160,6 @@ type UsersResponse struct {
|
||||||
Users []*User `json:"users,omitempty"`
|
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":
|
// method id "dex.RefreshClient.List":
|
||||||
|
|
||||||
type RefreshClientListCall struct {
|
type RefreshClientListCall struct {
|
||||||
|
|
|
@ -39,22 +39,6 @@ const DiscoveryJSON = `{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Client": {
|
|
||||||
"id": "Client",
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"id": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"redirectURIs": {
|
|
||||||
"required": true,
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"RefreshClient": {
|
"RefreshClient": {
|
||||||
"id": "Client",
|
"id": "Client",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
@ -86,40 +70,6 @@ const DiscoveryJSON = `{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ClientWithSecret": {
|
|
||||||
"id": "Client",
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"id": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"secret": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"redirectURIs": {
|
|
||||||
"required": true,
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"ClientPage": {
|
|
||||||
"id": "ClientPage",
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"clients": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"$ref": "Client"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nextPageToken": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"User": {
|
"User": {
|
||||||
"id": "User",
|
"id": "User",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
@ -244,37 +194,6 @@ const DiscoveryJSON = `{
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"resources": {
|
"resources": {
|
||||||
"Clients": {
|
|
||||||
"methods": {
|
|
||||||
"List": {
|
|
||||||
"id": "dex.Client.List",
|
|
||||||
"description": "Retrieve a page of Client objects.",
|
|
||||||
"httpMethod": "GET",
|
|
||||||
"path": "clients",
|
|
||||||
"parameters": {
|
|
||||||
"nextPageToken": {
|
|
||||||
"type": "string",
|
|
||||||
"location": "query"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"response": {
|
|
||||||
"$ref": "ClientPage"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Create": {
|
|
||||||
"id": "dex.Client.Create",
|
|
||||||
"description": "Register a new Client.",
|
|
||||||
"httpMethod": "POST",
|
|
||||||
"path": "clients",
|
|
||||||
"request": {
|
|
||||||
"$ref": "Client"
|
|
||||||
},
|
|
||||||
"response": {
|
|
||||||
"$ref": "ClientWithSecret"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Users": {
|
"Users": {
|
||||||
"methods": {
|
"methods": {
|
||||||
"List": {
|
"List": {
|
||||||
|
|
|
@ -33,22 +33,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Client": {
|
|
||||||
"id": "Client",
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"id": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"redirectURIs": {
|
|
||||||
"required": true,
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"RefreshClient": {
|
"RefreshClient": {
|
||||||
"id": "Client",
|
"id": "Client",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
@ -80,40 +64,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ClientWithSecret": {
|
|
||||||
"id": "Client",
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"id": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"secret": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"redirectURIs": {
|
|
||||||
"required": true,
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"ClientPage": {
|
|
||||||
"id": "ClientPage",
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"clients": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"$ref": "Client"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nextPageToken": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"User": {
|
"User": {
|
||||||
"id": "User",
|
"id": "User",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
@ -238,37 +188,6 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"resources": {
|
"resources": {
|
||||||
"Clients": {
|
|
||||||
"methods": {
|
|
||||||
"List": {
|
|
||||||
"id": "dex.Client.List",
|
|
||||||
"description": "Retrieve a page of Client objects.",
|
|
||||||
"httpMethod": "GET",
|
|
||||||
"path": "clients",
|
|
||||||
"parameters": {
|
|
||||||
"nextPageToken": {
|
|
||||||
"type": "string",
|
|
||||||
"location": "query"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"response": {
|
|
||||||
"$ref": "ClientPage"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Create": {
|
|
||||||
"id": "dex.Client.Create",
|
|
||||||
"description": "Register a new Client.",
|
|
||||||
"httpMethod": "POST",
|
|
||||||
"path": "clients",
|
|
||||||
"request": {
|
|
||||||
"$ref": "Client"
|
|
||||||
},
|
|
||||||
"response": {
|
|
||||||
"$ref": "ClientWithSecret"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Users": {
|
"Users": {
|
||||||
"methods": {
|
"methods": {
|
||||||
"List": {
|
"List": {
|
||||||
|
|
Loading…
Reference in a new issue