Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update connector templates to default external
The connector templates were originally written for internal connectors, but will be used as a guide by people building external connectors. This commit revises the languages in the README to default to an external-connector building audience, but maintains the guidelines for building internal connectors.
- Loading branch information
Geri Jennings
committed
Dec 30, 2019
1 parent
591dc87
commit c248c50
Showing
6 changed files
with
52 additions
and
20 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -1,16 +1,37 @@ | ||
# Using templates to implement Secretless Connector Plugins | ||
|
||
We created connector templates to ease the process of adding new connectors to secretless. | ||
Before using the templates to add new connector plugins, be sure to read the [Secretless Connector Plugins README](https://github.com/cyberark/secretless-broker/blob/master/pkg/secretless/plugin/connector/README.md) | ||
|
||
To add a new connector do the following: | ||
|
||
1. Copy the relevant template directory (HTTP/TCP) into `internal/plugin/connectors/<connector type>`. | ||
If you're not sure which connector type is suitable, please refer to the [connector technical overview](https://github.com/cyberark/secretless-broker/tree/master/pkg/secretless/plugin/connector#technical-overview). | ||
1. Inside each template directory you will find the required files & structs implemented, | ||
with instructions in the form of TODOs to fill them with the content of the new connector. | ||
1. Add an entry to the `Plugins` map defined in GetInternalPluginsFunc() of | ||
[`internal_plugins.go`](../../pkg/secretless/plugin/sharedobj/internal_plugins.go), according to their type (HTTP/TCP) | ||
1. Copy the [`template_connector_test`](template_connector_test) directory into `test/connector/<connector type>/` and rename it to `<connector_name>`. | ||
1. This directory will help you write integration tests for your connector. It contains test scripts & files to help you stand up networked containers with docker-compose. The files give instructions on the steps to set up your test suite in the form of TODOs. | ||
The [`Jenkinsfile`](../../Jenkinsfile) is set up to automatically run the integration tests with each project build. | ||
# Using templates to create Secretless Connector Plugins | ||
|
||
We created the templates in this directory to make it easier to add new | ||
connectors to Secretless. | ||
|
||
Before using the templates, be sure to read the [Secretless Connector Plugins | ||
README](https://github.com/cyberark/secretless-broker/blob/master/pkg/secretless/plugin/connector/README.md) | ||
|
||
To create a new Secretless connector plugin, follow these instructions: | ||
|
||
1. Copy the relevant template directory (HTTP/TCP) into a folder on your local | ||
machine (or to `internal/plugin/connectors/<connector_type>` if you are building | ||
an internal connector). | ||
|
||
If you're not sure which connector type is appropriate for your target service, | ||
please refer to the [connector technical overview](https://github.com/cyberark/secretless-broker/tree/master/pkg/secretless/plugin/connector#technical-overview) for guidelines. | ||
|
||
1. Update the copied files to implement your connector. Each file includes | ||
instructions in the form of `TODO`s. | ||
|
||
1. (**Internal Connectors Only**) Add an entry to the `Plugins` map defined in | ||
`GetInternalPluginsFunc()` of | ||
[`internal_plugins.go`](../../pkg/secretless/plugin/sharedobj/internal_plugins.go), | ||
according to your connector type (HTTP/TCP) | ||
|
||
1. To test your connector, copy the [`template_connector_test`](template_connector_test) | ||
directory onto your local machine. | ||
|
||
If you follow the `TODO`-based instructions included in the files in this directory, | ||
you will be able to write integration tests for your connector using `docker-compose`. | ||
The included test scripts & files will help you stand up networked containers with | ||
`docker-compose`. | ||
|
||
**Note for internal connectors:** The the test directory should be copied | ||
into `test/connector/<connector type>/` and renamed to `<connector_name>`. | ||
The [`Jenkinsfile`](../../Jenkinsfile) is set up to automatically run the | ||
integration tests from this directory with each project build. |
This file contains 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 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 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 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 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