Skip to content

Commit

Permalink
rebound-description (#1402)
Browse files Browse the repository at this point in the history
* fixed-components

* rebound_description

---------

Co-authored-by: Erroneous0ne <home@MacBook-Pro.local>
  • Loading branch information
erroneous0ne and Erroneous0ne authored Oct 17, 2024
1 parent 468479d commit abc157a
Show file tree
Hide file tree
Showing 13 changed files with 2,930 additions and 2,578 deletions.
86 changes: 45 additions & 41 deletions content/_components/git-protocol/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,18 @@ ComponentVersion: 1.2.5
updatedDate: 2024-09-04
---

## Table of Contents
* [General information](#general-information)
* [Description](#description)
* [Credentials](#credentials)
* [Actions](#actions)
* [Create Commit](#create-commit)
* [Config Fields](#config-fields)
* [Input Metadata](#input-metadata)
* [Output Metadata](#output-metadata)
* [Read from Branch](#read-from-branch)
* [Config Fields](#config-fields)
* [Input Metadata](#input-metadata)
* [Output Metadata](#output-metadata)

## General information

### Description
Git protocol component for the [elastic.io platform](http://www.elastic.io "elastic.io platform")

Git protocol component for the [{{site.data.tenant.name}} platform](http://www.{{site.data.tenant.name}})

## Credentials
- Passphrase (string/text box, optional): Passphrase to use to authenticate.
- Private SSH Key (string/text box, required): Private SSH key to use to authenticate. Example:

- Passphrase (string/text box, optional): Passphrase to use to authenticate
- Public SSH Key (string/text box, required): Public SSH key to use to authenticate

Example:

```
-----BEGIN RSA PRIVATE KEY-----
Expand All @@ -40,44 +31,54 @@ jnJHBGH68t76ghvdsaHJVH66657VCHHcEZD+aVRKDQwjIosXR8r88b==
-----END RSA PRIVATE KEY-----
```

<details>
<summary>Technical details</summary>
The only field available on Elastic's UI to provide a secure input is a 'PasswordFieldView' view class. The problem is that it replaces new line characters with spaces.
This method modifies the key in the following way. E.g. the key is:
> **Please note** that you need to add your SSH key to the server (GiHub, GitLab, etc.) first!
- Service URL (string, required): Url of the service to test the SSH key for validity

Example:

```
-----BEGIN RSA PRIVATE KEY-----
BASE64_ENCODED_DATA_LINE_1
BASE64_ENCODED_DATA_LINE_2
BASE64_ENCODED_DATA_LINE_3
-----END RSA PRIVATE KEY-----
git@github.com
```

The platform will then transform the key so:

-----BEGIN RSA PRIVATE KEY----- BASE64_ENCODED_DATA_LINE_1 BASE64_ENCODED_DATA_LINE_2 BASE64_ENCODED_DATA_LINE_3 -----END RSA PRIVATE KEY-----
- Git Project (string, required): Part of the git repo URL that is after the service URL. (e.g. If the Git Project is acme/git-protocol-component.git and the Service URL is git@github.com, then the full git URL should be git@github.com:acme/git-protocol-component.git

The code in the component replaces all the space characters (except for in the header and footer lines) with new line characters
</details>
- Private SSH Key (string/text box, required): Private SSH key to use to authenticate

- Public SSH Key (string/text box, required): Public SSH key to use to authenticate. Example:
Example:

```
ssh-rsa AAAAB3NzaC1yc2EAAAAD{.....}kf0vBMStV user@exampleHost
```

Please note that you need to add your SSH key to the server (GiHub, GitLab, etc.) first!
- Service URL (string, required): Url of the service to test the SSH key for validity. Example:
### Technical details

The only field available on Platform UI to provide a secure input is a 'PasswordFieldView' view class. The problem is that it replaces new line characters with spaces.
This method modifies the key in the following way. E.g. the key is:

```
git@github.com
-----BEGIN RSA PRIVATE KEY-----
BASE64_ENCODED_DATA_LINE_1
BASE64_ENCODED_DATA_LINE_2
BASE64_ENCODED_DATA_LINE_3
-----END RSA PRIVATE KEY-----
```

- Git Project (string, required): Part of the git repo URL that is after the service URL. (e.g. If the Git Project is elasticio/git-protocol-component.git and the Service URL is git@github.com, then the full git URL should be git@github.com:elasticio/git-protocol-component.git
The platform will then transform the key so:

-----BEGIN RSA PRIVATE KEY----- BASE64_ENCODED_DATA_LINE_1 BASE64_ENCODED_DATA_LINE_2 BASE64_ENCODED_DATA_LINE_3 -----END RSA PRIVATE KEY-----

The code in the component replaces all the space characters (except for in the header and footer lines) with new line character

## Triggers

This component has no trigger functions. This means it will not be accessible to
select as a first component during the integration flow design.

## Actions

### Create Commit

This action does the equivalent to
- git clone
- git checkout <branch>
Expand All @@ -89,7 +90,7 @@ This action does the equivalent to
#### Config Fields

- File Source. One of the following:
- Maester. Elastic's internal object storage
- Internal object storage
- URL. Internet (must be publicly available. Authentication mechanisms are not supported)

#### Input Metadata
Expand All @@ -106,8 +107,8 @@ This action does the equivalent to
- Date (string, optional: default to now). Time (in seconds from epoch) when the action happened
- Files to add to commit (array, required)
- File Source Meta (string, required): Dynamically generated. Will be one of the following depending on File Source chosen in the configuration:
- Configuration `Maester Object ID or Maester URL`: - either ID of the object in Maester (e.g. `797bb70d-1590-4136-b9db-2abb01983d92`) or the full Maester object URL (e.g. `http://maester-service.platform.svc.cluster.local:3002/objects/dbceb3f1-6d18-4eb4-9f08-2437b6ef685f?storage_type=maester`))
- Configuration `External URL`: External link to the file (e.g. `https://example.com/file.txt`). Must be publicly available. Authentication mechanisms are not supported
- Configuration 'Maester Object ID or Maester URL': - either ID of the object in Maester (e.g. `797bb70d-1590-4136-b9db-2abb01983d92`) or the full Maester object URL (e.g. `http://maester-service.platform.svc.cluster.local:3002/objects/dbceb3f1-6d18-4eb4-9f08-2437b6ef685f?storage_type=maester`))
- Configuration 'External URL': External link to the file (e.g. `https://example.com/file.txt`). Must be publicly available. Authentication mechanisms are not supported
- Filename + path (string, required): Location within the git repo to create the file
- Files to remove from the commit (array of strings, optional): List of files or file wildcards to remove as part of the commit. (equivalent to `git rm -r fileOne.txt fileTwo.txt someFolder`)

Expand All @@ -116,6 +117,7 @@ This action does the equivalent to
* commitId - ID of the commit in the repo

### Read from Branch

This action reads the files from a Git repository and saves them in Maester (Elastic's internal object storage)

#### Config Fields
Expand All @@ -132,14 +134,16 @@ This action reads the files from a Git repository and saves them in Maester (Ela
* commitId - ID of the commit in the repo

#### File patterns usage
Internally this library is being used to find the wildcards/patterns match: [https://www.npmjs.com/package/fast-glob](https://www.npmjs.com/package/fast-glob)

Internally this library is being used to find the wildcards/patterns match: https://www.npmjs.com/package/fast-glob

Examples:

1. Match all the files including all subdirectories (also note that 'Include hidden files' configuration field might affect the result): `'**'`
2. Match all the files of js type: `'**/*.js'`
3. Match a single file in the root folder: `'component.json'`
4. Match all the files in the given 'lib' folder: `'lib/**'`

## Known limitations

1. Maester object created by Sailor's Lightweight message feature can not be read (to be precise - they will be processed but not decrypted)
2. The repository must be initialized before executing the `Create Commit` action. This means that the repository must contain at least one commit (initial commit).
Loading

0 comments on commit abc157a

Please sign in to comment.