diff --git a/docs/_data/main-nav.yaml b/docs/_data/main-nav.yaml index 01d4de8..08e877f 100644 --- a/docs/_data/main-nav.yaml +++ b/docs/_data/main-nav.yaml @@ -171,8 +171,6 @@ toc: - title: CLI Command Reference url: /inso-cli/cli-command-reference subfolderitems: - - title: inso generate config - url: /inso-cli/cli-command-reference/inso-generate-config - title: inso run test url: /inso-cli/cli-command-reference/inso-run-test - title: inso lint spec @@ -181,8 +179,6 @@ toc: url: /inso-cli/cli-command-reference/inso-export-spec - title: inso script url: /inso-cli/cli-command-reference/inso-script - - title: OpenAPI Spec Reference - url: /inso-cli/cli-command-reference/OAS-spec.yml - title: Using Custom Linting with Inso CLI url: /inso-cli/cli-command-reference/inso-custom-linting - title: Configuration @@ -191,13 +187,6 @@ toc: url: /inso-cli/inso-on-docker - title: Continuous Integration url: /inso-cli/continuous-integration - - title: Work with Other Kong Products - collapse-id: kong-products - items: - - title: Kong Declarative Config (for decK) - url: /insomnia/declarative-config - - title: Kong for Kubernetes - url: /insomnia/kong-for-kubernetes - title: Pre-request Script collapse-id: pre-request-script items: diff --git a/docs/inso-cli/cli-command-reference.md b/docs/inso-cli/cli-command-reference.md index da0e578..7a0fc6c 100644 --- a/docs/inso-cli/cli-command-reference.md +++ b/docs/inso-cli/cli-command-reference.md @@ -12,7 +12,6 @@ This reference guide provides in-depth information about the Inso CLI commands. {:.table .table-striped} Command | Description ------- | ----------- -[inso generate config](/inso-cli/cli-command-reference/inso-generate-config) | Generate Kong declarative config or Kong for Kubernetes config from an OpenAPI spec (versions OpenAPI 2 and OpenAPI 3.0.X and 3.1 supported) using [openapi-2-kong](https://github.com/Kong/insomnia/tree/develop/packages/openapi-2-kong). [inso run test](/inso-cli/cli-command-reference/inso-run-test) | Execute unit tests written in Insomnia via a CLI. [inso lint spec](/inso-cli/cli-command-reference/inso-lint-spec) | Lint an OpenAPI specification (the latest version supports OpenAPI 3.1) via a CLI. (Custom Lint Ruleset support is in progress). [inso export spec](/inso-cli/cli-command-reference/inso-export-spec) | Export the raw OpenAPI specification from the Insomnia data store. diff --git a/docs/inso-cli/cli-command-reference/OAS-spec.yml b/docs/inso-cli/cli-command-reference/OAS-spec.yml deleted file mode 100644 index 4b8ad5a..0000000 --- a/docs/inso-cli/cli-command-reference/OAS-spec.yml +++ /dev/null @@ -1,606 +0,0 @@ -openapi: 3.0.0 - -## NOTE: NOT COMPATIBLE WITH KONG GATEWAY >= 3.0 ##### -info: - description: Learn service - version: 1.0.0 - title: Learn Service - - -servers: -- url: https://{host}.konghq.com/kongu/api/v1/learn - # the path variable {host} will be replaced by its default value below. - # NOTE: if multiple entries, then only the first one will be used for the service. The others - # will only be added as 'targets' (by their host+port, any other attributes will be ignored). - # A 'servers' block is currently only supported at the root of the document. - # Feature request: 'servers' can also be added to "path" and "operation" objects (mimic the OAS 3 spec) - description: Non production servers - variables: - host: - enum: - - alpha - - dev - - qa - default: alpha -- url: https://konghq.com/kongu/api/v1/learn - description: Production server - - -x-kong-service-defaults: - # the defaults for the Kong services generated from 'servers' above - # see https://docs.konghq.com/gateway/latest/admin-api/#service-object - retries: 10 - connect_timeout: 30000 - write_timeout: 30000 - read_timeout: 30000 - # Feature request: defaults can also be added to "path" and "operation" objects - - -x-kong-upstream-defaults: - # the defaults for the Kong upstreams (loadbalancers) generated from 'servers' above - # see https://docs.konghq.com/latest/admin-api/#upstream-object - hash_on: ip - healthchecks: - passive: - unhealthy: - http_failures: 3 - tcp_failures: 3 - timeouts: 3 - # Feature request: defaults can also be added to "path" and "operation" objects - - -x-kong-name: awesome_learnservice -# the above directive gives the entire spec file its name. This will be used for naming -# the service and upstream objects in Kong. If not given it will use the 'info.title' -# field above to name them. Names are converted into valid identifiers. For example, -# "Learn Services" becomes "Learn_Services". -# Feature request: honor this directive on paths and operation objects as well, currently only global - -x-kong-plugin-correlation-id: - config: - generator: uuid#counter -# this plugin is configured on a global level. As such it will be configured -# on the Kong Service entity, and hence apply on all paths and operations in this spec. -# It can be specified again on paths and operations to override the config for that -# specific subset of the spec, in that case it will be added to the generated Kong Route entity. - -x-kong-plugin-request-validator: - config: - #body_schema: {} - #parameter_schema: {} - verbose_response: true -# here we're using the request validator plugin, without specifying the -# "config.body_schema" and "config.parameter_schema" properties. -# This will tell the parser to automatically generate -# their validation configuration based on Operation objects. -# NOTE: this is specified on top level, causing ALL Operations to get -# validation, since this is inherited to the Operation objects. -# alternatively it can be specified on the Path or Operation levels as well -# to only apply to that subset of the spec. - -tags: -- name: learn - description: Operations for tracks and videos -- name: activities - description: Operations for quiz, track activities, video watching activities -# FAQ: why aren't the tags generated into the Kong configuration? -# The OAS tags are very strongly oriented towards documentation, whereas the Kong tags -# are use for segmentation of configuration. They serve completely different and incompatible -# purposes. - -x-kong-route-defaults: - # the defaults for the Kong routes generated from 'paths' below - # see https://docs.konghq.com/latest/admin-api/#route-object - preserve_host: true - # NOTE: these defaults can also be added to "path" and "operation" objects - # to only apply to that subset of the spec. - - -paths: - "/tracks": - # FAQ: why does the generated configuration have a trailing "$"? - # The OAS spec defines exact paths, where the Kong configuration defines path prefixes. - # Hence the generated configuration is actually a regex, with an end marker to ensure Kong - # will also do an exact match. Otherwise for example a path "/tracks/whatever" would also - # match this path. - post: - tags: - - learn - summary: Upsert tracks - operationId: upsertTracks - # Kong routes are generated from the top-level Service name (x-kong-name or info.title - # if x-kong-name is not set), and then the operationId gets appended (with '-' as separator) - # so the generated route name here is "awesome_learnservice-upsertTracks" - # If operationId is not specified, the default name will be the global x-kong-name - # with the path name and operation type. - # If x-kong-name is set on the path-le - # [specname]-[operationId] - # [specname]-[x-kong-name on path level]-[operation] --> if no "operationId" provided - # where [specname] is the x-kong-name on global level (or in its absence "info.title") - x-kong-plugin-request-termination: - name: request-termination - config: - status_code: 403 - message: So long and thanks for all the fish! - # the "x-kong-plugin-" directive can be used to add plugins - # to Kong routes (OAS operation object). - # The configuration provided is the exact same configuration as used on the Admin-API - # for that plugin. - responses: - '200': - description: Successful operation - content: - application/json: - schema: - type: array - items: - "$ref": "#/components/schemas/LearningCenterTrack" - '400': - description: Bad Request - requestBody: - "$ref": "#/components/requestBodies/tracks" - get: - tags: - - learn - summary: Get the tracks of a user - operationId: getUserTracks - security: - - openId: [ "scope3" ] - # TODO: validate security generated all together!!! report about it being broken - # See #/components/securitySchemes for the definition - # NOTE: only a single scheme per security object is supported! - x-kong-plugin-file-log: - "$ref": "#/components/x-kong/plugins/log_to_file" - # Adding another plugin, but in this case we use a reference so any updates - # to the configuration can be done in a single place. - parameters: - # for these parameters to get validated, "x-kong-plugin-request-validator" must be - # specified, see that directive above. - - name: userId - in: query - description: id of the user - required: true - schema: - pattern: ^[a-f0-9]{12}1[a-f0-9]{3}[89ab][a-f0-9]{15}$ - type: string - - name: trackIds - in: query - description: track ids to get - required: false - schema: - type: array - items: - description: trackId - type: string - minItems: 0 - responses: - '200': - description: Successful operation - content: - application/json: - schema: - type: array - items: - "$ref": "#/components/schemas/UserLearningCenterTrack" - '400': - description: Bad Request - "/tracks/system": - get: - tags: - - learn - summary: Gets system tracks for a user - operationId: getSystemTracks - security: - - basicAuth: [] - # TODO: validate security generated all together!!! report about it being broken - # See #/components/securitySchemes for the definition - parameters: - - name: userId - in: query - description: id of the user - required: true - schema: - type: string - responses: - '200': - description: Successful operation - content: - application/json: - schema: - type: array - items: - "$ref": "#/components/schemas/LearningCenterTrack" - '400': - description: Bad Request - "/tracks/{id}": - delete: - tags: - - learn - summary: Delete a Track by Id - operationId: deleteTrack - security: - - keyAuth: [] - # TODO: validate security generated all together!!! report about it being broken - # See #/components/securitySchemes for the definition - parameters: - - name: id - in: path - description: Id of the Track to delete - required: true - schema: - "$ref": "#/components/schemas/TrackId" - responses: - '200': - description: successful operation - content: - application/json: - schema: - "$ref": "#/components/schemas/LearningCenterTrack" - '400': - description: Bad Request - "/videos": - get: - tags: - - learn - summary: Get Learning Center Videos for a user - description: Returns Learning Center Videos for a user - operationId: getVideos - parameters: - - name: userId - in: query - description: id of the user - required: true - schema: - type: string - responses: - '200': - description: Successful operation - content: - application/json: - schema: - type: array - items: - "$ref": "#/components/schemas/LearningCenterVideo" - '400': - description: Bad Request - post: - tags: - - learn - summary: Upsert Learning Center Videos - operationId: upsertVideos - responses: - '200': - description: Successful operation - content: - application/json: - schema: - type: array - items: - "$ref": "#/components/schemas/LearningCenterVideo" - '400': - description: Bad Request - requestBody: - "$ref": "#/components/requestBodies/Video" - -#TODO: cleanup unused stuff in components below -components: - x-kong: - # reusable Kong plugin configurations - plugins: - log_to_file: - # file-log plugin configuration - config: - path: "/dev/stderr" - - securitySchemes: - basicAuth: - type: http - scheme: basic - x-kong-security-basic-auth: - # using this directive, the scheme can be extended with Kong-specific - # configuration options. - # NOTE: the directive name is "security", not "plugin"! because it - # extends the existing OAS security directives - config: - hide_credentials: true - keyAuth: - type: apiKey - name: apikey - in: header - # NOTE: 'in' will be ignored since Kong will always look in header and - # query anyway for key-auth. - x-kong-security-key-auth: - config: - key_names: [ "mykey", "yourkey" ] - # the "key_names" will be merged with the name specified in OAS above - # so effectively keynames that will be accepted are now: "apikey", - # "mykey", and "yourkey". - hide_credentials: true - run_on_preflight: false - openId: - type: openIdConnect - openIdConnectUrl: https://konghq.com/oauth2/.well-known/openid-configuration - x-kong-security-openid-connect: - # we specify that the Kong OpenID COnnect plugin is to be used to implement this - # "security scheme object". Any custom configuration can be added as usual - # for plugins. - config: - run_on_preflight: false - scopes_required: ["scope1", "scope2"] - # the "scopes_required" listed here will be merged with the scopes specified - # on the security requirement. So if an Operation specifies a security - # requirement with "scope3", then the effective scopes applied will - # be "scope1", "scope2", and "scope3". For example: "read", "write", or - # "delete". - - schemas: - Track: - type: object - description: Track - properties: - id: - "$ref": "#/components/schemas/TrackId" - index: - type: integer - format: int32 - minimum: 1 - maximum: 100000000 - description: - "$ref": "#/components/schemas/parameterValue" - category: - "$ref": "#/components/schemas/parameterValue" - subcategory: - "$ref": "#/components/schemas/parameterValue" - quizId: - "$ref": "#/components/schemas/parameterValue" - assetClass: - "$ref": "#/components/schemas/parameterValue" - UserLearningCenterTrack: - type: object - properties: - id: - description: Id of a learning center track - type: string - index: - type: integer - format: int64 - description: - type: string - category: - type: string - subcategory: - type: string - quizId: - type: string - isEnabled: - type: boolean - assetClass: - type: string - LearningCenterTrack: - type: object - properties: - id: - description: Id of a learning center track - type: string - index: - type: integer - format: int64 - description: - type: string - category: - type: string - subcategory: - type: string - quizId: - type: string - entitlements: - type: array - items: - type: string - minItems: 0 - assetClass: - type: string - LearningCenterVideo: - type: object - properties: - id: - description: Id of a learning center video - type: string - index: - type: integer - format: int64 - title: - type: string - abbreviation: - type: string - trackId: - "$ref": "#/components/schemas/TrackId" - tileSummary: - type: string - category: - type: string - subcategory: - type: string - thumbnail: - type: string - baseUrl: - type: string - duration: - type: string - TrackId: - description: Id of a learning center track - type: string - minLength: 1 - maxLength: 5 - TrackActivities: - description: Contains the Track activities of a user - type: object - properties: - userId: - "$ref": "#/components/schemas/parameterValue" - tracks: - type: array - items: - "$ref": "#/components/schemas/TrackActivity" - TrackActivity: - type: object - properties: - trackId: - "$ref": "#/components/schemas/TrackId" - quizId: - "$ref": "#/components/schemas/parameterValue" - quizAttempts: - type: integer - videosWatched: - type: array - items: - "$ref": "#/components/schemas/VideoActivity" - VideoActivity: - type: object - properties: - videoId: - "$ref": "#/components/schemas/parameterValue" - timestamp: - "$ref": "#/components/schemas/dateOrTimestamp" - sessionId: - "$ref": "#/components/schemas/parameterValue" - QuizResult: - description: Quiz Result - type: object - properties: - userId: - "$ref": "#/components/schemas/parameterValue" - session: - "$ref": "#/components/schemas/parameterValue" - track: - "$ref": "#/components/schemas/TrackId" - quizId: - "$ref": "#/components/schemas/parameterValue" - passed: - description: determines whether the user passed the quiz - type: boolean - score: - type: number - format: double - minimum: 0.1 - maximum: 100000000 - scoreSheet: - description: Scoresheet for Quiz - type: array - minItems: 1 - maxItems: 1000 - items: - type: boolean - timestamp: - description: Timestamp of quiz result - type: string - pattern: "^[\\w\\- :.*/\\\\]{1,128}$" - CertificationStatusItem: - type: object - properties: - track: - type: string - timestamp: - "$ref": "#/components/schemas/dateOrTimestamp" - LearningCenterTrackSummary: - type: object - properties: - trackId: - "$ref": "#/components/schemas/TrackId" - completed: - type: integer - inProgress: - type: integer - notStarted: - type: integer - TrackIdLearningCenterUserTrackDetailsMap: - type: object - additionalProperties: - "$ref": "#/components/schemas/LearningCenterUserTrackDetails" - LearningCenterUserTrackDetails: - type: object - required: - - videosWatched - - certificateEarned - - quizAttempts - - videoCompletionTimes - properties: - videosWatched: - type: array - items: - type: boolean - quizScore: - type: number - format: double - certificateEarned: - type: boolean - quizAttempts: - type: integer - videoCompletionTimes: - type: array - items: - type: string - format: date-time - quizCompletionTime: - type: string - format: date-time - LearningCenterUserSummary: - type: object - required: - - completed - - inProgress - - notStarted - properties: - completed: - type: integer - inProgress: - type: integer - notStarted: - type: integer - parameterValue: - anyOf: - - "$ref": "#/components/schemas/symbol" - - "$ref": "#/components/schemas/sanitized_number" - - "$ref": "#/components/schemas/symbolArray" - dateOrTimestamp: - oneOf: - - type: string - format: dateTime - - type: string - format: date - - type: string - pattern: "^[0-9]{4}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}$" - symbol: - type: string - maxLength: 4096 - symbolArray: - type: array - items: - "$ref": "#/components/schemas/symbol" - minItems: 0 - maxItems: 1000 - sanitized_number: - type: integer - minimum: -1000000000 - maximum: 1000000000 - requestBodies: - tracks: - content: - application/json: - schema: - type: array - minItems: 1 - items: - "$ref": "#/components/schemas/Track" - Video: - content: - application/json: - schema: - type: object - properties: - videos: - type: array - minItems: 1 - maxItems: 1000 - items: - "$ref": "#/components/schemas/LearningCenterVideo" diff --git a/docs/inso-cli/cli-command-reference/inso-generate-config.md b/docs/inso-cli/cli-command-reference/inso-generate-config.md deleted file mode 100644 index 60578f9..0000000 --- a/docs/inso-cli/cli-command-reference/inso-generate-config.md +++ /dev/null @@ -1,108 +0,0 @@ ---- -layout: article-detail -title: inso generate config -category: "CLI Command Reference" -category-url: inso-cli ---- - -The `inso generate config` command generates a configuration from an API specification by using [openapi-2-kong](https://github.com/Kong/insomnia/tree/develop/packages/openapi-2-kong). The command works similarly to generating a [declarative configuration](/insomnia/declarative-config) file or [Kubernetes manifest](/insomnia/kong-for-kubernetes) from within Insomnia. - -For more in-depth information on working with other Kong products, see: - -* [Kong Declarative Config (for decK)](/insomnia/declarative-config/) -* [Kong for Kubernetes](/insomnia/kong-for-kubernetes) - -## Command - -```bash -inso generate config [identifier] -``` - -[`identifier`](/inso-cli/introduction/#the-identifier-argument) is a specification name, or id, or a file path. - -## Options - -{:.table .table-striped} -Option | Alias | Description ------ | ----- | ------ -`--type ` | `-t` | type of configuration to generate, options are `kubernetes` and `declarative` (default: `declarative`) -`--output ` | `-o` | save the generated config to a file in the working directory. When not specified, will write the config to `/dev/stdout` without logging extraneous usage information. -`--format` | `-f` | output format, either `yaml` or `json`. This option only applies to type `declarative`, and will be ignored for type `kubernetes` (default: `yaml`) -`--kongVersion ` | `-k` | version of target Kong instance, options are [legacy, 3] (default: legacy) -`--tags ` | | comma-separated list of tags to apply to each entity - -## Global Flags - -{:.table .table-striped} -Option | Alias | Description ------ | ------ | ------- -`--output ` | -o | Save the specification to a file in the working directory. -`--workingDir ` || Specify a working directory. -`--src ` || Specify the V4 export file or the Insomnia app data directory. You can use this option to set a Git data directory. If not specified, `inso-cli` looks for an `.insomnia` folder in the working directory by default. - -## Examples - -The following commands work when running in the example [git-repo](https://github.com/Kong/insomnia/tree/develop/packages/insomnia-inso/src/db/fixtures/git-repo) directory. - -When you don't specify any arguments, you'll be prompted with: - -```bash -inso generate config -``` - -Scope configuration generation by the Document name or ID: - -```bash -inso generate config spc_46c5a4 -``` - -```bash -inso generate config "Sample Specification" -``` - -Scope configuration generation by a file on the filesystem: - -```bash -inso generate config spec.yaml -``` - -```bash -inso generate config spec.yaml --workingDir another/dir -``` - -Save the configuration output to a file: - -```bash -inso generate config spc_46c5a4 --output output.yaml -``` - -```bash -inso generate config spc_46c5a4 > output.yaml -``` - -Save the configuration output to a file with json output: - -```bash -inso generate config spc_46c5a4 --output output.json --format json -``` - -Add tags to your generated configuration: -`inso generate config spec.yaml --workingDir another/dir` - -```bash -inso generate config spec.yaml --tags first -``` - -```bash -inso generate config spec.yaml --tags "first,second" -``` - -Change the generated configuration output type to either `declarative` or `kubernetes`: - -```bash -inso generate config spc_46c5a4 --type declarative -``` - -```bash -inso generate config "Sample Specification" --type kubernetes -``` diff --git a/docs/inso-cli/cli-command-reference/inso-script.md b/docs/inso-cli/cli-command-reference/inso-script.md index 1710275..1e79e65 100644 --- a/docs/inso-cli/cli-command-reference/inso-script.md +++ b/docs/inso-cli/cli-command-reference/inso-script.md @@ -33,9 +33,6 @@ The following commands work when running in the example [git-repo](https://githu scripts: lint: lint spec "Sample Specification" - - gen-conf: generate config "Sample Specification" - gen-conf:k8s: gen-conf --type kubernetes ``` Run commands with or without the `script` prefix: diff --git a/docs/inso-cli/configuration.md b/docs/inso-cli/configuration.md index 3d922dc..28a255b 100644 --- a/docs/inso-cli/configuration.md +++ b/docs/inso-cli/configuration.md @@ -19,7 +19,7 @@ Alternatively, you can use the `--config ` global option to specify an exa ## Options -Options from the config file are combined with option defaults and any explicit overrides specified in script or command invocations. This combination is in the following priority order: +Options from the config file are combined with option defaults and any explicit overrides specified in script or command invocations. This combination is in the following priority order: 1. command options 2. config file options @@ -49,7 +49,4 @@ scripts: test-request-suite: inso run test uts_bce4af --env DemoEnv --bail lint: inso lint spec Demo # must be invoked as `inso script lint` - - gen-conf: inso generate config "Designer Demo" --type declarative - gen-conf:k8s: inso gen-conf --type kubernetes ``` diff --git a/docs/inso-cli/continuous-integration.md b/docs/inso-cli/continuous-integration.md index 4c8c599..7d8a64a 100644 --- a/docs/inso-cli/continuous-integration.md +++ b/docs/inso-cli/continuous-integration.md @@ -13,7 +13,6 @@ An example workflow run in Github Actions does the following: 2. Downloads [Setup Inso GitHub Action](https://github.com/marketplace/actions/setup-inso) 3. Runs linting 4. Runs unit tests -5. Generates a [Declarative Configuration](/insomnia/declarative-config) file ## Setup Inso Workflow @@ -38,6 +37,4 @@ jobs: run: inso lint spec "Designer Demo" --ci - name: Run test suites run: inso run test "Designer Demo" --env UnitTest --ci - - name: Generate declarative config - run: inso generate config "Designer Demo" --type declarative --ci ``` diff --git a/docs/inso-cli/inso-on-docker.md b/docs/inso-cli/inso-on-docker.md index e25b522..8996ac4 100644 --- a/docs/inso-cli/inso-on-docker.md +++ b/docs/inso-cli/inso-on-docker.md @@ -30,9 +30,6 @@ cd # Run Unit Tests docker run -it --rm -v $(pwd):/var/temp kong/inso:latest run test -w /var/temp - -# Generate Kong Declarative config -docker run -it --rm -v $(pwd):/var/temp kong/inso:latest generate config -w /var/temp -f json ``` ## Mount Application Data folder diff --git a/docs/inso-cli/introduction.md b/docs/inso-cli/introduction.md index e27966c..591b2c2 100644 --- a/docs/inso-cli/introduction.md +++ b/docs/inso-cli/introduction.md @@ -67,16 +67,8 @@ The identifier can also be the entity name. For example, if a unit test suite ID Additionally, if the `identifier` argument is omitted from the command, Inso CLI will search in the database for the information it needs, and prompt the user. Prompts can be disabled with the `--ci` global option. -## Git Bash +## OpenAPI to Kong Gateway configuration -Git Bash on Windows is not interactive, so prompts from Inso CLI will not work as expected. You can specify identifiers for each command explicitly, or run Inso CLI using a tool like [winpty](https://github.com/rprichard/winpty). The following is an example Inso CLI command using winpty: +You can combine Insomnia's CLI with Kong Gateway's **decK CLI** to automatically generate Kong Gateway configurations from your OpenAPI specifications, while ensuring that they are tested and linted with Insomnia in the meantime. -```bash -winpty inso.cmd generate config -``` - -## Compatibility with Kong Gateway - -By default Inso-cli generated files are compatible with legacy Kong Gateway versions < 3.0 on command ```inso generate config```. - -If you wish to generate for newer Kong Gateway versions be sure to use the `--kongVersion 3` option when running ```inso generate config```. +To learn more read the official documentation for [decK's configuration generation](https://docs.konghq.com/deck/latest/guides/apiops/#configuration-generation). diff --git a/docs/insomnia/declarative-config.md b/docs/insomnia/declarative-config.md deleted file mode 100644 index 6735520..0000000 --- a/docs/insomnia/declarative-config.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -layout: article-detail -title: Kong Declarative Config (for decK) -category: "Work with Other Kong Products" -category-url: kong-products ---- - -{:.alert .alert-primary} -**Note**: This feature is currently only available on Design Documents with OpenAPI 3.0.X and 3.1 specifications. - -Insomnia creates a preformatted [decK](https://docs.konghq.com/deck) file when you add endpoints to a Document. You can do this through the UI, as explained below. Or by using the Inso CLI command [inso generate config](/inso-cli/cli-command-reference/inso-generate-config). - -You can also upload a Declarative Config file directly to your [Kong Gateway instance](https://docs.konghq.com/gateway-oss). Learn how from the Kong Docs [Loading the Declarative Configuration File](https://docs.konghq.com/gateway-oss/2.5.x/db-less-and-declarative-config/#loading-the-declarative-configuration-file). - -## Get a Declarative Config File Through Insomnia - -1. Open a Document. -2. Add an OpenAPI 3.0 Specification. If you have another Swagger version, use a tool like [editor.swagger.io](https://editor.swagger.io/) to convert to OpenAPI 3.0. -3. Click on the arrow next to the Document name. -4. In the dropdown menu, click **Declarative Config**. - -![Next to the Document name, click the arrow to access the dropdown menu and click Declarative Config](/assets/images/declarative-config.png) - -## Authentication in Declarative Config - -The generated Declarative Configuration file contains authentication plugin information. `openid-connect`, as seen in the example screenshot below, is only compatible with Kong Gateway Enterprise. Ensure you define authentication that's compatible with your Kong Gateway instance. - -See [Security Plugins](https://github.com/Kong/insomnia/tree/develop/packages/openapi-2-kong#security-plugins) in the [OpenAPI 2 Kong Declarative Config](https://github.com/Kong/insomnia/tree/develop/packages/openapi-2-kong#kong-declarative-config) for a list of authentication types and their corresponding plugins. - -![In the generated file, you will see authentication plugins defined.](/assets/images/dec-config-auth.png) - -We use [OpenAPI 2 Kong Declarative Config](https://github.com/Kong/insomnia/tree/develop/packages/openapi-2-kong#kong-declarative-config) to generate the Declarative Config file. diff --git a/docs/insomnia/hooks-and-actions.md b/docs/insomnia/hooks-and-actions.md index 7469546..9af2bae 100644 --- a/docs/insomnia/hooks-and-actions.md +++ b/docs/insomnia/hooks-and-actions.md @@ -188,26 +188,3 @@ interface DocumentAction { // Document actions are exported as an array of objects module.exports.documentActions = Array; ``` - -## Config Generator - -Config generators show in the Document settings dropdown, and can be used to generate configuration from an OpenAPI spec. - -```ts -interface ConfigGenerator { - label: string; - docsLink?: string; - generate: (spec: { - contents: Record; - rawContents: string; - format: string; - formatVersion: string; - }) => Promise<{ - document?: string; - error?: string; - }>; -}; - -// Config generators are exported as an array of objects -module.exports.configGenerators = Array; -``` diff --git a/docs/insomnia/kong-for-kubernetes.md b/docs/insomnia/kong-for-kubernetes.md deleted file mode 100644 index 6317051..0000000 --- a/docs/insomnia/kong-for-kubernetes.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -layout: article-detail -title: Kong for Kubernetes -category: "Work with Other Kong Products" -category-url: kong-products ---- - -{:.alert .alert-primary} -**Note**: This feature is currently only available on Design Documents with OpenAPI 3.0.X and 3.1 specifications. - -Insomnia can take a Document and output a Kubernetes manifest. You can do this either through the UI, as explained below. Or by using the Inso CLI command [inso generate config](/inso-cli/cli-command-reference/inso-generate-config). - -Once you have added your OpenAPI spec, click on the arrow next to your Document name. In the dropdown menu, click **Kong for Kubernetes**. - -![Next to the Document name, click the arrow to access the dropdown menu and click Kong for Kubernetes](/assets/images/kong-for-kubernetes.png) - -We use [OpenAPI 2 Kong Declarative Config](https://github.com/Kong/insomnia/tree/develop/packages/openapi-2-kong#kong-declarative-config) to generate the Kong for Kubernetes file. diff --git a/docs/sitemap.xml b/docs/sitemap.xml index f52149f..d8330ab 100644 --- a/docs/sitemap.xml +++ b/docs/sitemap.xml @@ -300,16 +300,6 @@ 2022-04-20T14:38:46+00:00 0.64 - - https://docs.insomnia.rest/insomnia/declarative-config - 2022-04-20T14:38:46+00:00 - 0.64 - - - https://docs.insomnia.rest/insomnia/kong-for-kubernetes - 2022-04-20T14:38:46+00:00 - 0.64 - https://docs.insomnia.rest/insomnia/authentication/ 2022-04-20T14:38:46+00:00 @@ -340,11 +330,6 @@ 2022-04-20T14:38:46+00:00 0.51 - - https://docs.insomnia.rest/insomnia/declarative-config/ - 2022-04-20T14:38:46+00:00 - 0.51 - https://docs.insomnia.rest/inso-cli/introduction/ 2022-04-20T14:38:46+00:00