Skip to content

Commit

Permalink
Resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffy-mathew committed Dec 21, 2023
1 parent 2109629 commit 6e93b7c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 121 deletions.
36 changes: 16 additions & 20 deletions gateway/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@
// The code below describes the Tyk Gateway API
// Version: 2.8.0
//
// Schemes: https, http
// Host: localhost
// BasePath: /tyk/
// Schemes: https, http
// Host: localhost
// BasePath: /tyk/
//
// Consumes:
// - application/json
// Consumes:
// - application/json
//
// Produces:
// - application/json
// Produces:
// - application/json
//
// Security:
// - api_key:
// Security:
// - api_key:
//
// SecurityDefinitions:
// api_key:
// type: apiKey
// name: X-Tyk-Authorization
// in: header
// SecurityDefinitions:
// api_key:
// type: apiKey
// name: X-Tyk-Authorization
// in: header
//
// swagger:meta
package gateway
Expand All @@ -44,7 +44,6 @@ import (

"github.com/gorilla/mux"
"github.com/lonelycode/osin"
"github.com/sirupsen/logrus"
"github.com/spf13/afero"
"golang.org/x/crypto/bcrypt"

Expand All @@ -56,16 +55,15 @@ import (

gql "github.com/TykTechnologies/graphql-go-tools/pkg/graphql"

<<<<<<< HEAD
"github.com/TykTechnologies/tyk/internal/uuid"
=======
)

const (
oAuthClientTokensKeyPattern = "oauth-data.*oauth-client-tokens.*"
)

var (
ErrRequestMalformed = errors.New("request malformed")
>>>>>>> 63739304... [TT-10189/TT-10467] Add OAuthPurgeLapsedTokens (#5766)
)

// apiModifyKeySuccess represents when a Key modification was successful
Expand Down Expand Up @@ -349,7 +347,6 @@ func (gw *Gateway) doAddOrUpdate(keyName string, newSession *user.SessionState,
// remove from all stores, update to all stores, stores handle quotas separately though because they are localised! Keys will
// need to be managed by API, but only for GetDetail, GetList, UpdateKey and DeleteKey

//
func (gw *Gateway) setBasicAuthSessionPassword(session *user.SessionState) {
basicAuthHashAlgo := gw.basicAuthHashAlgo()

Expand Down Expand Up @@ -1328,7 +1325,6 @@ func (gw *Gateway) groupResetHandler(w http.ResponseWriter, r *http.Request) {
// was in the URL parameters, it will block until the reload is done.
// Otherwise, it won't block and fn will be called once the reload is
// finished.
//
func (gw *Gateway) resetHandler(fn func()) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var wg sync.WaitGroup
Expand Down
14 changes: 2 additions & 12 deletions gateway/oauth_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,18 @@ import (
"sync"
"time"

<<<<<<< HEAD
"github.com/TykTechnologies/tyk/request"
"github.com/sirupsen/logrus"

=======
"github.com/hashicorp/go-multierror"
>>>>>>> 63739304... [TT-10189/TT-10467] Add OAuthPurgeLapsedTokens (#5766)
"github.com/lonelycode/osin"
"github.com/sirupsen/logrus"
"golang.org/x/crypto/bcrypt"

"github.com/TykTechnologies/tyk/internal/uuid"
"github.com/TykTechnologies/tyk/request"

"strconv"

<<<<<<< HEAD
"github.com/TykTechnologies/tyk/internal/uuid"

"github.com/TykTechnologies/tyk/headers"
=======
"github.com/TykTechnologies/tyk/header"
tykerrors "github.com/TykTechnologies/tyk/internal/errors"
>>>>>>> 63739304... [TT-10189/TT-10467] Add OAuthPurgeLapsedTokens (#5766)
"github.com/TykTechnologies/tyk/storage"
"github.com/TykTechnologies/tyk/user"
)
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ require (
github.com/hashicorp/go-hclog v0.14.1 // indirect
github.com/hashicorp/go-immutable-radix v1.3.0 // indirect
github.com/hashicorp/go-msgpack v0.5.5 // indirect
github.com/hashicorp/go-multierror v1.1.0
github.com/hashicorp/go-retryablehttp v0.6.7 // indirect
github.com/hashicorp/memberlist v0.1.6 // indirect
github.com/hashicorp/serf v0.8.6 // indirect
Expand Down
89 changes: 0 additions & 89 deletions swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -883,95 +883,6 @@ paths:
example:
- "tok1"
- "tok2"
<<<<<<< HEAD
=======
'/tyk/oauth/revoke':
post:
description: revoke a single token
summary: revoke token
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema:
type: object
properties:
token:
description: token to be revoked
type: string
client_id:
description: id of oauth client
type: string
token_type_hint:
description: type of token to be revoked, if sent then the accepted values are access_token and refresh_token. String value and optional, of not provided then it will attempt to remove access and refresh tokens that matchs
type: string
example:
token: eyJvcmciOiI1ZTIwOTFjNGQ0YWVmY2U2MGMwNGZiOTIiLCJpZCI6ImJlMjlhYjVkODc1OTRhZDJhYTBhNjAwNzFlNzE1ZmQxIiwiaCI6Im11cm11cjY0In0=
client_id: 411f0800957c4a3e81fe181141dbc22a
tags:
- OAuth
operationId: revokeSingleToken
responses:
'200':
description: Succesful response
'/tyk/oauth/revoke_all':
post:
description: revoke all the tokens for a given oauth client
summary: revoke all client's tokens
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema:
type: object
properties:
client_id:
description: id of oauth client
type: string
client_secret:
description: OAuth client secret to ensure that its a valid operation
type: string
example:
client_id: 411f0800957c4a3e81fe181141dbc22a
client_secret: N2Y0YjgzMjctMTEwNi00YWExLWJjM2MtYjg1NWZhM2M1NmNj
tags:
- OAuth
operationId: revokeAllTokens
responses:
'200':
description: Succesful response
'400':
description: Bad request, form malformed or client secret and client id doesn't match
'404':
description: oauth client doesn't have any api related

'/tyk/oauth/tokens':
delete:
description: Delete lapsed OAuth tokens from Redis.
summary: Delete lapsed OAuth tokens(expired tokens which are past `oauth_token_expired_retain_period`)
parameters:
- description: scope in which tokens are to be deleted.
name: scope
in: query
required: true
schema:
type: string
enum: [lapsed]
example: lapsed
tags:
- OAuth
operationId: purgeLapsedTokens
responses:
'200':
description: Lapsed tokens purged.
'400':
description: Bad request, value of scope parameter is not valid.
'422':
description: Cannot process request when scope parameter is missing.
'500':
description: Internal server error while purging lapsed tokens.

>>>>>>> 63739304... [TT-10189/TT-10467] Add OAuthPurgeLapsedTokens (#5766)
'/tyk/oauth/refresh/{keyName}':
delete:
summary: Invalidate OAuth refresh token
Expand Down

0 comments on commit 6e93b7c

Please sign in to comment.