-
Notifications
You must be signed in to change notification settings - Fork 378
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
feat: add license agent openapi proxy #6147
Changes from 7 commits
eb197ba
e959a21
b5eb558
ace4c3e
921cab1
e9fcd6e
e3f7b67
7edd63b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
CREATE TABLE erda_licenses | ||
( | ||
`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '许可证ID', | ||
`entity_type` ENUM('PLATFORM', 'ORG') NOT NULL COMMENT '实体类型', | ||
`entity_id` BIGINT NOT NULL DEFAULT 0 COMMENT '实体ID', | ||
`enc_license` TEXT COMMENT '加密许可证信息', | ||
`created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', | ||
`updated_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', | ||
PRIMARY KEY (`id`), | ||
UNIQUE KEY entity_entity_id (entity_type, entity_id) | ||
) COMMENT '许可证信息表'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package apistructs | ||
|
||
type RegisterLicenseRequest struct { | ||
Scope int64 `json:"scope"` | ||
License string `json:"license"` | ||
} | ||
|
||
type RegisterLicenseResponse struct { | ||
Id int64 `json:"id"` | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright (c) 2021 Terminus, Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package license_agent | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please identify the license for the project. |
||
|
||
import ( | ||
"net/http" | ||
|
||
"github.com/erda-project/erda/internal/core/openapi/legacy/api/apis" | ||
) | ||
|
||
var AGENT_LICENSE_FEATURE_GET = apis.ApiSpec{ | ||
Path: "/api/licenses/features", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. strange path There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
BackendPath: "/api/licenses/features", | ||
Host: "license-agent.marathon.l4lb.thisdcos.directory:8080", | ||
Scheme: "http", | ||
Method: http.MethodGet, | ||
IsOpenAPI: true, | ||
CheckLogin: true, | ||
CheckToken: true, | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright (c) 2021 Terminus, Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package license_agent | ||
|
||
import ( | ||
"net/http" | ||
|
||
"github.com/erda-project/erda/internal/core/openapi/legacy/api/apis" | ||
) | ||
|
||
var AGENT_LICENSE_GET = apis.ApiSpec{ | ||
Path: "/api/licenses", | ||
BackendPath: "/api/licenses", | ||
Host: "license-agent.marathon.l4lb.thisdcos.directory:8080", | ||
Scheme: "http", | ||
Method: http.MethodGet, | ||
IsOpenAPI: true, | ||
CheckLogin: true, | ||
CheckToken: true, | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Copyright (c) 2021 Terminus, Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package license_agent | ||
|
||
import ( | ||
"net/http" | ||
|
||
"github.com/erda-project/erda/apistructs" | ||
"github.com/erda-project/erda/internal/core/openapi/legacy/api/apis" | ||
) | ||
|
||
var AGENT_REGISTER_LICENSE_POST = apis.ApiSpec{ | ||
Path: "/api/licenses/actions/register", | ||
BackendPath: "/api/licenses/actions/register", | ||
Host: "license-agent.marathon.l4lb.thisdcos.directory:8080", | ||
Scheme: "http", | ||
Method: http.MethodPost, | ||
IsOpenAPI: true, | ||
CheckLogin: true, | ||
CheckToken: true, | ||
RequestType: apistructs.RegisterLicenseRequest{}, | ||
ResponseType: apistructs.RegisterLicenseResponse{}, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use singular format for table name:
erda_license