Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change: remove self-contained info fields from ssl definition #10323

Merged
merged 1 commit into from Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 0 additions & 6 deletions apisix/schema_def.lua
Expand Up @@ -784,10 +784,6 @@ _M.ssl = {
},
required = {"ca"},
},
exptime = {
type = "integer",
minimum = 1588262400, -- 2020/5/1 0:0:0
},
labels = labels_def,
status = {
description = "ssl status, 1 to enable, 0 to disable",
Expand All @@ -804,8 +800,6 @@ _M.ssl = {
enum = {"TLSv1.1", "TLSv1.2", "TLSv1.3"}
},
},
validity_end = timestamp_def,
validity_start = timestamp_def,
create_time = timestamp_def,
update_time = timestamp_def
},
Expand Down
70 changes: 14 additions & 56 deletions t/admin/ssl.t
Expand Up @@ -268,45 +268,7 @@ passed



=== TEST 9: store exptime
--- config
location /t {
content_by_lua_block {
local core = require("apisix.core")
local t = require("lib.test_admin")

local ssl_cert = t.read_file("t/certs/apisix.crt")
local ssl_key = t.read_file("t/certs/apisix.key")
local data = {
cert = ssl_cert, key = ssl_key,
sni = "bar.com",
exptime = 1588262400 + 60 * 60 * 24 * 365,
}

local code, body = t.test('/apisix/admin/ssls/1',
ngx.HTTP_PUT,
core.json.encode(data),
[[{
"value": {
"sni": "bar.com",
"exptime": 1619798400
},
"key": "/apisix/ssls/1"
}]]
)

ngx.status = code
ngx.say(body)
}
}
--- request
GET /t
--- response_body
passed



=== TEST 10: string id
=== TEST 9: string id
--- config
location /t {
content_by_lua_block {
Expand Down Expand Up @@ -334,7 +296,7 @@ passed



=== TEST 11: string id(delete)
=== TEST 10: string id(delete)
--- config
location /t {
content_by_lua_block {
Expand All @@ -361,7 +323,7 @@ passed



=== TEST 12: invalid id
=== TEST 11: invalid id
--- config
location /t {
content_by_lua_block {
Expand All @@ -388,7 +350,7 @@ GET /t



=== TEST 13: set ssl with multicerts(id: 1)
=== TEST 12: set ssl with multicerts(id: 1)
--- config
location /t {
content_by_lua_block {
Expand Down Expand Up @@ -429,7 +391,7 @@ passed



=== TEST 14: mismatched certs and keys
=== TEST 13: mismatched certs and keys
--- config
location /t {
content_by_lua_block {
Expand Down Expand Up @@ -467,7 +429,7 @@ GET /t



=== TEST 15: set ssl(with labels)
=== TEST 14: set ssl(with labels)
--- config
location /t {
content_by_lua_block {
Expand Down Expand Up @@ -505,7 +467,7 @@ passed



=== TEST 16: invalid format of label value: set ssl
=== TEST 15: invalid format of label value: set ssl
--- config
location /t {
content_by_lua_block {
Expand Down Expand Up @@ -542,7 +504,7 @@ GET /t



=== TEST 17: create ssl with manage fields(id: 1)
=== TEST 16: create ssl with manage fields(id: 1)
--- config
location /t {
content_by_lua_block {
Expand All @@ -554,19 +516,15 @@ GET /t
local data = {
cert = ssl_cert,
key = ssl_key,
sni = "test.com",
validity_start = 1602873670,
validity_end = 1603893670
sni = "test.com"
}

local code, body = t.test('/apisix/admin/ssls/1',
ngx.HTTP_PUT,
core.json.encode(data),
[[{
"value": {
"sni": "test.com",
"validity_start": 1602873670,
"validity_end": 1603893670
"sni": "test.com"
},
"key": "/apisix/ssls/1"
}]]
Expand All @@ -583,7 +541,7 @@ passed



=== TEST 18: delete test ssl(id: 1)
=== TEST 17: delete test ssl(id: 1)
--- config
location /t {
content_by_lua_block {
Expand All @@ -599,7 +557,7 @@ GET /t



=== TEST 19: create/patch ssl
=== TEST 18: create/patch ssl
--- config
location /t {
content_by_lua_block {
Expand Down Expand Up @@ -664,7 +622,7 @@ passed



=== TEST 20: missing sni information
=== TEST 19: missing sni information
--- config
location /t {
content_by_lua_block {
Expand Down Expand Up @@ -695,7 +653,7 @@ GET /t



=== TEST 21: type client, missing sni information
=== TEST 20: type client, missing sni information
--- config
location /t {
content_by_lua_block {
Expand Down