Skip to content

Commit eee8094

Browse files
authored
Revert "[TT-5588] [OAS] gateway apiKey import generates unnecessary object (#…"
This reverts commit 8b4fa8e.
1 parent 35d2b2d commit eee8094

File tree

2 files changed

+1
-16
lines changed

2 files changed

+1
-16
lines changed

apidef/oas/security.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ type Token struct {
3030
Enabled bool `bson:"enabled" json:"enabled"` // required
3131

3232
// AuthSources contains the configuration for authentication sources.
33-
AuthSources `bson:",inline" json:"-"`
33+
AuthSources `bson:",inline" json:",inline"`
3434

3535
// EnableClientCertificate allows to create dynamic keys based on certificates.
3636
//

apidef/oas/security_test.go

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package oas
22

33
import (
4-
"encoding/json"
54
"sort"
65
"testing"
76

@@ -277,20 +276,6 @@ func TestOAS_Token(t *testing.T) {
277276
convertedOAS.fillToken(api)
278277

279278
assert.Equal(t, oas, convertedOAS)
280-
281-
// Make sure AuthSources are not serialized into json.
282-
token.Query = &AuthSource{Enabled: true}
283-
token.Header = &AuthSource{Enabled: true}
284-
token.Cookie = &AuthSource{Enabled: true}
285-
bytes, err := json.Marshal(token)
286-
assert.NoError(t, err)
287-
288-
var unmarshalledToken Token
289-
err = json.Unmarshal(bytes, &unmarshalledToken)
290-
assert.NoError(t, err)
291-
assert.Nil(t, unmarshalledToken.Query)
292-
assert.Nil(t, unmarshalledToken.Header)
293-
assert.Nil(t, unmarshalledToken.Cookie)
294279
}
295280

296281
func TestOAS_Token_MultipleSecuritySchemes(t *testing.T) {

0 commit comments

Comments
 (0)