Skip to content
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

Interceptors: Migrate CEL and source control interceptors to a separate server #867

Closed
dibyom opened this issue Dec 16, 2020 · 0 comments · Fixed by #878
Closed

Interceptors: Migrate CEL and source control interceptors to a separate server #867

dibyom opened this issue Dec 16, 2020 · 0 comments · Fixed by #878
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@dibyom
Copy link
Member

dibyom commented Dec 16, 2020

The work for this issue is to migrate the core interceptors (minus webhook) to run on their own deployment. The EL will send HTTP requests using the interface specified in TEP-0026.

Part of TEP-0026

@dibyom dibyom added the kind/feature Categorizes issue or PR as related to a new feature. label Dec 16, 2020
@dibyom dibyom added this to the Triggers v0.11 milestone Dec 16, 2020
@dibyom dibyom self-assigned this Dec 16, 2020
dibyom added a commit to dibyom/triggers that referenced this issue Dec 22, 2020
Storing the body as `json.RawMessage` can lead to loss of information about
spaces in the incoming body when the InterceptorRequest is marshaled as JSON
before sending it over HTTP.

This is because Go's `json.Marshal` will encode `[]byte` as a base64 string and
base64 does not preserve spaces. Adding a custom `MarshalJSON` does not help
here since `MarshalJSON` will return a `[]byte` that will then get compacted as
base64 by `json.Marshal`.

This loss of spaces can be problematic for some use cases. For instance, the
GitHub payload signature validation requires us to compare using the exact body
as it was sent. Otherwise, the validation fails. Note that this will only be a
problem when we marshal the InterceptorRequest i.e. when we move the core
interceptors out to its own server.

Using a string means that the string will be quoted e.g. `{\"foo\": \"bar\"}`.
Go should take care of unquoting it during the unmarshaling process. However,
intercetpor authors using a different language will have to manually unquote
the string by parsing it as a JSON object.

Part of tektoncd#271, tektoncd#867

Signed-off-by: Dibyo Mukherjee <dibyo@google.com>
dibyom added a commit to dibyom/triggers that referenced this issue Dec 22, 2020
Storing the body as `json.RawMessage` can lead to loss of information about
spaces in the incoming body when the InterceptorRequest is marshaled as JSON
before sending it over HTTP.

This is because Go's `json.Marshal` will encode `[]byte` as a base64 string and
base64 does not preserve spaces. Adding a custom `MarshalJSON` does not help
here since `MarshalJSON` will return a `[]byte` that will then get compacted as
base64 by `json.Marshal`.

This loss of spaces can be problematic for some use cases. For instance, the
GitHub payload signature validation requires us to compare using the exact body
as it was sent. Otherwise, the validation fails. Note that this will only be a
problem when we marshal the InterceptorRequest i.e. when we move the core
interceptors out to its own server.

Using a string means that the string will be quoted e.g. `{\"foo\": \"bar\"}`.
Go should take care of unquoting it during the unmarshaling process. However,
intercetpor authors using a different language will have to manually unquote
the string by parsing it as a JSON object.

Part of tektoncd#271, tektoncd#867

Signed-off-by: Dibyo Mukherjee <dibyo@google.com>
dibyom added a commit to dibyom/triggers that referenced this issue Dec 23, 2020
The EventListener will forward events over HTTP to the interceptor.  Each core
interceptor is available at a different path e.g. /cel for CEL.

Fixes tektoncd#867

Signed-off-by: Dibyo Mukherjee <dibyo@google.com>
dibyom added a commit to dibyom/triggers that referenced this issue Dec 23, 2020
Storing the body as `json.RawMessage` can lead to loss of information about
spaces in the incoming body when the InterceptorRequest is marshaled as JSON
before sending it over HTTP.

This is because Go's `json.Marshal` will encode `[]byte` as a base64 string and
base64 does not preserve spaces. Adding a custom `MarshalJSON` does not help
here since `MarshalJSON` will return a `[]byte` that will then get compacted as
base64 by `json.Marshal`.

This loss of spaces can be problematic for some use cases. For instance, the
GitHub payload signature validation requires us to compare using the exact body
as it was sent. Otherwise, the validation fails. Note that this will only be a
problem when we marshal the InterceptorRequest i.e. when we move the core
interceptors out to its own server.

Using a string means that the string will be quoted e.g. `{\"foo\": \"bar\"}`.
Go should take care of unquoting it during the unmarshaling process. However,
intercetpor authors using a different language will have to manually unquote
the string by parsing it as a JSON object.

Part of tektoncd#271, tektoncd#867

Signed-off-by: Dibyo Mukherjee <dibyo@google.com>
tekton-robot pushed a commit that referenced this issue Dec 23, 2020
Storing the body as `json.RawMessage` can lead to loss of information about
spaces in the incoming body when the InterceptorRequest is marshaled as JSON
before sending it over HTTP.

This is because Go's `json.Marshal` will encode `[]byte` as a base64 string and
base64 does not preserve spaces. Adding a custom `MarshalJSON` does not help
here since `MarshalJSON` will return a `[]byte` that will then get compacted as
base64 by `json.Marshal`.

This loss of spaces can be problematic for some use cases. For instance, the
GitHub payload signature validation requires us to compare using the exact body
as it was sent. Otherwise, the validation fails. Note that this will only be a
problem when we marshal the InterceptorRequest i.e. when we move the core
interceptors out to its own server.

Using a string means that the string will be quoted e.g. `{\"foo\": \"bar\"}`.
Go should take care of unquoting it during the unmarshaling process. However,
intercetpor authors using a different language will have to manually unquote
the string by parsing it as a JSON object.

Part of #271, #867

Signed-off-by: Dibyo Mukherjee <dibyo@google.com>
dibyom added a commit to dibyom/triggers that referenced this issue Dec 23, 2020
The EventListener will forward events over HTTP to the interceptor.  Each core
interceptor is available at a different path e.g. /cel for CEL.

Fixes tektoncd#867

Signed-off-by: Dibyo Mukherjee <dibyo@google.com>
dibyom added a commit to dibyom/triggers that referenced this issue Dec 23, 2020
The EventListener will forward events over HTTP to the interceptor.  Each core
interceptor is available at a different path e.g. /cel for CEL.

Fixes tektoncd#867

Signed-off-by: Dibyo Mukherjee <dibyo@google.com>
dibyom added a commit to dibyom/triggers that referenced this issue Dec 23, 2020
The EventListener will forward events over HTTP to the interceptor.  Each core
interceptor is available at a different path e.g. /cel for CEL.

Fixes tektoncd#867

Signed-off-by: Dibyo Mukherjee <dibyo@google.com>
dibyom added a commit to dibyom/triggers that referenced this issue Dec 23, 2020
The EventListener will forward events over HTTP to the interceptor.  Each core
interceptor is available at a different path e.g. /cel for CEL.

Fixes tektoncd#867

Signed-off-by: Dibyo Mukherjee <dibyo@google.com>
dibyom added a commit to dibyom/triggers that referenced this issue Dec 23, 2020
The EventListener will forward events over HTTP to the interceptor.  Each core
interceptor is available at a different path e.g. /cel for CEL.

Fixes tektoncd#867

Signed-off-by: Dibyo Mukherjee <dibyo@google.com>
dibyom added a commit to dibyom/triggers that referenced this issue Dec 29, 2020
The EventListener will forward events over HTTP to the interceptor.  Each core
interceptor is available at a different path e.g. /cel for CEL.

Fixes tektoncd#867

Signed-off-by: Dibyo Mukherjee <dibyo@google.com>
dibyom added a commit to dibyom/triggers that referenced this issue Dec 30, 2020
The EventListener will forward events over HTTP to the interceptor.  Each core
interceptor is available at a different path e.g. /cel for CEL.

Fixes tektoncd#867

Signed-off-by: Dibyo Mukherjee <dibyo@google.com>
dibyom added a commit to dibyom/triggers that referenced this issue Dec 30, 2020
The EventListener will forward events over HTTP to the interceptor.  Each core
interceptor is available at a different path e.g. /cel for CEL.

Fixes tektoncd#867

Signed-off-by: Dibyo Mukherjee <dibyo@google.com>
tekton-robot pushed a commit that referenced this issue Jan 7, 2021
The EventListener will forward events over HTTP to the interceptor.  Each core
interceptor is available at a different path e.g. /cel for CEL.

Fixes #867

Signed-off-by: Dibyo Mukherjee <dibyo@google.com>
dibyom added a commit to dibyom/triggers that referenced this issue Jan 20, 2021
The EventListener will forward events over HTTP to the interceptor.  Each core
interceptor is available at a different path e.g. /cel for CEL.

Fixes tektoncd#867

Signed-off-by: Dibyo Mukherjee <dibyo@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant