Skip to content

Commit

Permalink
feat(all): introduce new namespace endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
donch1989 committed Jul 23, 2024
1 parent ea765a4 commit ee503bc
Show file tree
Hide file tree
Showing 12 changed files with 251 additions and 256 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/sync-api-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ jobs:
sync-openapi-public:
name: Sync public docs on new release
needs: [sync-openapi-private]
needs: [sync-openapi-private-staging]
runs-on: ubuntu-latest
if: needs.sync-openapi-private.outputs.new_release != ''
steps:
Expand Down
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ repos:
hooks:
- id: check-yaml
- id: end-of-file-fixer
exclude: common/openapi
- id: trailing-whitespace
- repo: https://github.com/pinglin/conventional-pre-commit
rev: v1.1.0
Expand Down
10 changes: 5 additions & 5 deletions artifact/artifact/v1alpha/openapi.proto.templ
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import "protoc-gen-openapiv2/options/annotations.proto";
// These options define the OpenAPI definition document information.
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
info: {
title: "💾 Artifact ";
description: "Artifact endpoints to manage artifact resources";
{{$info}}
};
tags: [];
title: "💾 Artifact "
description: "Artifact endpoints to manage artifact resources"
{{$info}}
}
tags: []
{{$conf}}
};
3 changes: 0 additions & 3 deletions buf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,3 @@ lint:
rpc_allow_google_protobuf_empty_requests: false
rpc_allow_google_protobuf_empty_responses: false
service_suffix: Service
build:
excludes:
# - bazel-grpc-gateway
40 changes: 20 additions & 20 deletions common/openapi/v1beta/api_config.conf
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
// API config injected from common configuration.
host: "api.instill.tech";
host: "api.instill.tech"
external_docs: {
url: "https://www.instill.tech/docs";
description: "More about Instill AI";
};
schemes: HTTPS;
schemes: HTTP;
consumes: "application/json";
produces: "application/json";
url: "https://www.instill.tech/docs"
description: "More about Instill AI"
}
schemes: HTTPS
schemes: HTTP
consumes: "application/json"
produces: "application/json"
security_definitions: {
security: {
key: "Bearer";
key: "Bearer"
value: {
type: TYPE_API_KEY;
in: IN_HEADER;
name: "Authorization";
description: "Enter the token with the `Bearer ` prefix, e.g. `Bearer abcde12345`";
type: TYPE_API_KEY
in: IN_HEADER
name: "Authorization"
description: "Enter the token with the `Bearer ` prefix, e.g. `Bearer abcde12345`"
extensions: {
key: "x-default";
value {string_value: "Bearer instill_sk_***"};
key: "x-default"
value: {string_value: "Bearer instill_sk_***"}
}
}
}
}
security: {
security_requirement: {
key: "Bearer";
value: {};
key: "Bearer"
value: {}
}
}
responses: {
key: "401";
value: {description: "Returned when the client credentials are not valid."};
}
key: "401"
value: {description: "Returned when the client credentials are not valid."}
}
16 changes: 8 additions & 8 deletions common/openapi/v1beta/api_info.conf
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// API info injected from common configuration.
version: "v0.36.0-beta";
version: "v0.36.0-beta"
contact: {
name: "Instill AI";
url: "https://github.com/instill-ai";
email: "[email protected]";
};
name: "Instill AI"
url: "https://github.com/instill-ai"
email: "[email protected]"
}
license: {
name: "Elastic License 2.0 (ELv2)";
url: "https://github.com/instill-ai/protobufs/blob/main/LICENSE";
};
name: "Elastic License 2.0 (ELv2)"
url: "https://github.com/instill-ai/protobufs/blob/main/LICENSE"
}
4 changes: 2 additions & 2 deletions core/mgmt/v1beta/mgmt_public_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ service MgmtPublicService {
// Returns the auth token issuer details. This operation requires admin permissions.
rpc AuthTokenIssuer(AuthTokenIssuerRequest) returns (AuthTokenIssuerResponse) {
option (google.api.http) = {
post: "/v1beta/auth/token_issuer",
post: "/v1beta/auth/token_issuer"
body: "*"
};
option (google.api.method_visibility).restriction = "INTERNAL";
Expand All @@ -355,7 +355,7 @@ service MgmtPublicService {
// Updates the password of a user.
rpc AuthChangePassword(AuthChangePasswordRequest) returns (AuthChangePasswordResponse) {
option (google.api.http) = {
post: "/v1beta/auth/change_password",
post: "/v1beta/auth/change_password"
body: "*"
};
option (google.api.method_visibility).restriction = "INTERNAL";
Expand Down
24 changes: 12 additions & 12 deletions core/mgmt/v1beta/openapi.proto.templ
Original file line number Diff line number Diff line change
Expand Up @@ -6,43 +6,43 @@ import "protoc-gen-openapiv2/options/annotations.proto";

option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
info: {
title: "🔮 Core";
description: "Core endpoints to manage user resources";
title: "🔮 Core"
description: "Core endpoints to manage user resources"
{{$info}}
};
}
tags: [
{
name: "User",
name: "User"
description: "User endpoints"
},
{
name: "Organization",
name: "Organization"
description: "Organization endpoints"
},
{
name: "Membership",
name: "Membership"
description: "Membership endpoints"
},
{
name: "Token",
name: "Token"
description: "Token endpoints"
},
{
name: "Subscription",
name: "Subscription"
description: "Subscription endpoints"
},
{
name: "Credit",
name: "Credit"
description: "Credit endpoints"
},
{
name: "Metric",
name: "Metric"
description: "Metric endpoints"
},
{
name: "Utils",
name: "Utils"
description: "Util endpoints"
}
];
]
{{$conf}}
};
Loading

0 comments on commit ee503bc

Please sign in to comment.