-
Notifications
You must be signed in to change notification settings - Fork 85
feat(tencent-ssl): add Tencent SSL Certificate service package #280
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
Open
dingzhejianjian
wants to merge
4
commits into
chaitin:main
Choose a base branch
from
dingzhejianjian:dingzhejianjian-patch-2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
a15cb45
feat(tencent-ssl): add Tencent SSL Certificate service package
adc467a
fix: resolve merge conflict for tencent-ssl in octobus-tentacles
dingzhejianjian a305d47
fix: resolve merge conflict for tencent-ssl in package.json
dingzhejianjian 0df0dd0
fix: remove duplicate aliyun__waf3 entry in package.json files
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| # Tencent SSL Certificate Service Package | ||
|
|
||
| OctoBus package for Tencent Cloud SSL Certificate query APIs. | ||
|
|
||
| ## Device Version | ||
|
|
||
| SSL Certificate, API version 2019-12-05, endpoint `ssl.tencentcloudapi.com` | ||
|
|
||
| ## Authentication | ||
|
|
||
| Tencent Cloud API key (SecretId + SecretKey), TC3-HMAC-SHA256 signature. | ||
|
|
||
| ## Methods | ||
|
|
||
| | RPC Method | API Action | Type | Description | | ||
| |------------|-----------|------|-------------| | ||
| | `ListCertificates` | `DescribeCertificates` | Read | List all SSL certificates in the account | | ||
| | `GetCertificate` | `DescribeCertificateDetail` | Read | Get detailed info for a specific certificate | | ||
|
|
||
| ## Configuration | ||
|
|
||
| Config fields (non-sensitive, in `config`): | ||
|
|
||
| - `region`: Tencent Cloud region (default: `ap-guangzhou`) | ||
| - `timeoutMs`: HTTP timeout in milliseconds (default: 10000) | ||
|
|
||
| Secret fields (sensitive, in `secret`): | ||
|
|
||
| - `secret_id`: Tencent Cloud API SecretId | ||
| - `secretKey` / `secret_key`: Tencent Cloud API SecretKey | ||
|
|
||
| ## Import | ||
|
|
||
| ```bash | ||
| octobus service import tencent-ssl /path/to/tencent__ssl | ||
| ``` | ||
|
|
||
| ## Usage | ||
|
|
||
| ```bash | ||
| # Create instance | ||
| octobus instance create ssl-test \ | ||
| --service tencent-ssl \ | ||
| --secret-json '{"secret_id":"xxx","secretKey":"xxx"}' | ||
|
|
||
| # Create capset | ||
| octobus capset create ssl-dev --name SSL-Dev | ||
| octobus capset add-instance ssl-dev ssl-test | ||
|
|
||
| # List certificates via Connect RPC | ||
| curl -X POST \ | ||
| 'http://127.0.0.1:9000/capsets/ssl-dev/connect/ssl-test/Tencent_SSL.Tencent_SSL/ListCertificates' \ | ||
| -H 'Content-Type: application/json' \ | ||
| -d '{"limit":20}' | ||
|
|
||
| # Get certificate detail | ||
| curl -X POST \ | ||
| 'http://127.0.0.1:9000/capsets/ssl-dev/connect/ssl-test/Tencent_SSL.Tencent_SSL/GetCertificate' \ | ||
| -H 'Content-Type: application/json' \ | ||
| -d '{"certificate_id":"xxx"}' | ||
| ``` | ||
|
|
||
| ## Risk Notes | ||
|
|
||
| - All methods are read-only. No certificates are modified. | ||
| - The service is free to use - SSL certificates can be applied for free in Tencent Cloud console. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| #!/usr/bin/env node | ||
| import { runServiceMain } from '@chaitin-ai/octobus-sdk'; | ||
|
|
||
| import { service } from '../src/service.js'; | ||
|
|
||
| runServiceMain(service); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| { | ||
| "$schema": "https://json-schema.org/draft/2020-12/schema", | ||
| "type": "object", | ||
| "additionalProperties": true, | ||
| "properties": { | ||
| "region": { | ||
| "type": "string", | ||
| "description": "Tencent Cloud region (SSL API uses ap-guangzhou by default)." | ||
| }, | ||
| "timeoutMs": { | ||
| "type": "integer", | ||
| "minimum": 1, | ||
| "default": 10000, | ||
| "description": "HTTP timeout in milliseconds." | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| { | ||
| "name": "tencent-ssl", | ||
| "version": "0.0.0", | ||
| "private": true, | ||
| "type": "module", | ||
| "bin": { | ||
| "tencent-ssl": "bin/tencent-ssl.js" | ||
| }, | ||
| "dependencies": { | ||
| "@chaitin-ai/octobus-sdk": "^0.5.0" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package Tencent_SSL; | ||
|
|
||
| import "google/protobuf/wrappers.proto"; | ||
|
|
||
| option go_package = "miner/grpc-service/Tencent_SSL"; | ||
|
|
||
| service Tencent_SSL { | ||
| rpc ListCertificates(ListCertificatesRequest) returns (ListCertificatesResponse) {} | ||
| rpc GetCertificate(GetCertificateRequest) returns (GetCertificateResponse) {} | ||
| } | ||
|
|
||
| message ListCertificatesRequest { | ||
| google.protobuf.Int64Value limit = 1; | ||
| google.protobuf.Int64Value offset = 2; | ||
| } | ||
|
|
||
| message ListCertificatesResponse { | ||
| int32 code = 1; | ||
| string message = 2; | ||
| repeated CertificateItem data = 3; | ||
| int32 total = 4; | ||
| } | ||
|
|
||
| message CertificateItem { | ||
| string id = 1; | ||
| string domain = 2; | ||
| string cert_type = 3; | ||
| string status = 4; | ||
| string create_time = 5; | ||
| string expire_time = 6; | ||
| } | ||
|
|
||
| message GetCertificateRequest { | ||
| string certificate_id = 1; | ||
| } | ||
|
|
||
| message GetCertificateResponse { | ||
| int32 code = 1; | ||
| string message = 2; | ||
| string id = 3; | ||
| string domain = 4; | ||
| string cert_type = 5; | ||
| string status = 6; | ||
| string create_time = 7; | ||
| string expire_time = 8; | ||
| string subject = 9; | ||
| repeated string san = 10; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| { | ||
| "$schema": "https://json-schema.org/draft/2020-12/schema", | ||
| "type": "object", | ||
| "additionalProperties": true, | ||
| "properties": { | ||
| "secret_id": { | ||
| "type": "string", | ||
| "description": "Tencent Cloud API SecretId." | ||
| }, | ||
| "secretKey": { | ||
| "type": "string", | ||
| "description": "Tencent Cloud API SecretKey." | ||
| }, | ||
| "secret_key": { | ||
| "type": "string", | ||
| "description": "Alias for secretKey." | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| { | ||
| "schema": "chaitin.octobus.service.v1", | ||
| "name": "tencent-ssl", | ||
| "displayName": "Tencent SSL Certificate", | ||
| "description": "OctoBus package for Tencent Cloud SSL Certificate query APIs.", | ||
| "runtime": { | ||
| "mode": "long-running" | ||
| }, | ||
| "proto": { | ||
| "roots": [ | ||
| "proto" | ||
| ], | ||
| "files": [ | ||
| "proto/tencent_ssl.proto" | ||
| ] | ||
| }, | ||
| "configSchema": "config.schema.json", | ||
| "secretSchema": "secret.schema.json", | ||
| "sdk": { | ||
| "cli": { | ||
| "commands": { | ||
| "Tencent_SSL.Tencent_SSL/ListCertificates": { | ||
| "name": "list-certificates", | ||
| "description": "List all SSL certificates in the account." | ||
| }, | ||
| "Tencent_SSL.Tencent_SSL/GetCertificate": { | ||
| "name": "get-certificate", | ||
| "description": "Get detailed info for a specific certificate." | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| import { defineService } from '@chaitin-ai/octobus-sdk'; | ||
|
|
||
| import { handlers } from './tencent-ssl.js'; | ||
|
|
||
| export { handlers } from './tencent-ssl.js'; | ||
|
|
||
| export const service = defineService({ handlers }); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.