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

[TT-2539] added access/transaction logs #6616

Open
wants to merge 91 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
44c3967
Revert "Revert "[TT-2539] added access/transaction logs" (#6524)"
LLe27 Oct 8, 2024
f4470c9
[TT-13186/TT-13199] implement upstream basic authentication (#6596)
jeffy-mathew Oct 9, 2024
d0a04e0
[TT-13243] Test/ci improvements (#6611)
titpetric Oct 9, 2024
9b1ff8d
[TT-13139] Request times out in some cases when sending input via htt…
buraksezer Oct 9, 2024
0acea13
[TT-13238] Clean up RPC data model (#6608)
titpetric Oct 9, 2024
8ef7c6d
[TT-13242] Moved/Cleaned up nestedApiDefinition to model.MergedAPI (#…
titpetric Oct 9, 2024
667a549
[TT-13258] exp/workflow-lint: Update to latest known actions (#6620)
buger Oct 10, 2024
86a3d28
[TT-13266] Fix python tests (#6624)
titpetric Oct 10, 2024
e31a08f
[TT-12897] Merge path based permissions when combining policies (#6597)
titpetric Oct 10, 2024
849d346
[TT-13262] Fix/delete build cache for plugin compiler (#6623)
titpetric Oct 10, 2024
71941ea
[TT-8004/TT-13092]enable validate request middleware during OAS impor…
jeffy-mathew Oct 11, 2024
69344f9
[TT-13186/TT-13199] replace auth header instead of adding auth header…
jeffy-mathew Oct 11, 2024
74c514c
[TT-13280] Adjust golangci-lint to raise up errors in PRs directly (#…
titpetric Oct 14, 2024
6b687a2
TT-13130 updated version of gorpc library and prevent panic on start …
sredxny Oct 14, 2024
2b577bd
[TT-13184] Implement OAuth 2.0 Client Credentials Flow for GW authent…
andrei-tyk Oct 14, 2024
24058e8
[TT-12897/TT-13284] Add additional partitioned test case, fix orderin…
titpetric Oct 15, 2024
35500ee
[TT-12814] Make schema more flexible, don't enforce additionalPropert…
titpetric Oct 15, 2024
e004269
refactor access logs and tests
Oct 15, 2024
8f37f4b
TT-13130 update gorpc version (#6644)
sredxny Oct 16, 2024
33db0e2
Tt 13184 Upstream OAuth2 updates to fix TTL issue (#6643)
andrei-tyk Oct 17, 2024
cf5aeb0
[TT-12990] fix upstream endpoint RL not considering endpoint method (…
jeffy-mathew Oct 18, 2024
aee8137
TT-13269 - Refactor/streams (#6593)
titpetric Oct 19, 2024
1fcb4fd
[TT-12702] revert wrappedServeHTTP to use recordDetail (#6654)
jeffy-mathew Oct 23, 2024
14d8e3e
[TT-11426/TT-13322] Add deprecation notice for external OAuth middlew…
jeffy-mathew Oct 24, 2024
93f430c
[TT-13185] Implement Password Flow OAuth (#6649)
andrei-tyk Oct 24, 2024
c1b4429
[TT-13381] Linters should only work for PRs (#6664)
titpetric Oct 24, 2024
cea1df4
[TT-12417] Do not delete keys on synchronization (#6642)
mativm02 Oct 24, 2024
917f0ef
[TT-13185] reorganize contract in upstream oauth (#6668)
andrei-tyk Oct 25, 2024
deaa79e
[TT-13271] custom oauth response fields (#6660)
andrei-tyk Oct 25, 2024
29bc56a
[TT-13400] Fixing OTel CI (#6659)
mativm02 Oct 25, 2024
f1b55b5
[TT-13359] move upstream basic auth to ee package (#6669)
jeffy-mathew Oct 27, 2024
bb09d39
[TT-13185] upstream oauth allowed_authorize_types not being filled on…
andrei-tyk Oct 28, 2024
dafbab6
TT-13185, fixed lines lost in merge conflicts (#6681)
andrei-tyk Oct 29, 2024
b42113c
added logic to check for access log custom template
Oct 29, 2024
479dcd9
[TT-13375/TT-13422] Add validation rules for Upstream auth (#6680)
jeffy-mathew Oct 30, 2024
0c8a86a
[TT-13008]: modified default streams logger (#6682)
kofoworola Oct 30, 2024
3114d14
[TT-13185] fix missing extracts (#6685)
andrei-tyk Oct 30, 2024
3633678
[TT-11426/TT-13322]add deprecation notice for oidc middleware (#6686)
jeffy-mathew Oct 31, 2024
4a14e3a
[TT-13201] Streams Definition Validator (#6656)
buraksezer Oct 31, 2024
85e8a94
TT-13271, fix for token metadata not being cached (#6689)
andrei-tyk Nov 1, 2024
9335a51
[TT-12885] Add plugin development guide for manual builds (#6598)
titpetric Nov 2, 2024
fa63dbe
[TT-13391] Move upstream OAuth to EE (#6684)
andrei-tyk Nov 5, 2024
2611a47
improve error handling of streams in non-ee version (TT-13269) (#6691)
pvormste Nov 6, 2024
d7bed08
[TT-13375] Improved Upstream Auth validation rules (#6694)
lghiur Nov 6, 2024
810f981
add stream analytics to ee (TT-13233) (#6671)
pvormste Nov 6, 2024
36afb48
[TT-13271] Make enabled and allowedAuthorizeTypes required fields (#6…
lghiur Nov 7, 2024
79a393e
[TT-13508] Streams poor performance when reconnecting to a Streams AP…
buraksezer Nov 8, 2024
6db3156
[TT-13422] Do not allow empty string in upstream auth configuration s…
jeffy-mathew Nov 8, 2024
adb1f25
[TT-13508] Downgrade Bento to v1.2.0 and use our own fork to cherry-p…
buraksezer Nov 8, 2024
43ac641
[TT-13535/TT-13566] make upstream oauth password client secret not re…
jeffy-mathew Nov 13, 2024
f0fcb3f
Revert "[TT-13422] Do not allow empty string in upstream auth configu…
jeffy-mathew Nov 14, 2024
c8f21dc
[TT-13535/TT-13566] Make upstream oauth flow client secret omitempty …
jeffy-mathew Nov 18, 2024
cb62825
[TT-13485] update dependencies with vulnerabilities reported (#6711)
jeffy-mathew Nov 19, 2024
e19f5cf
[TT-13475] update OAS version (#6712)
lghiur Nov 19, 2024
6eb5178
[TT-13535/TT-13566] Ease up required fields in classic API schema (#6…
jeffy-mathew Nov 19, 2024
72dd619
[TT-13607] Only import components/io and components/kafka (#6720)
buraksezer Nov 20, 2024
7081f2e
[TT-13507] Fix for custom domains with substring listen path (#6705)
andrei-tyk Nov 21, 2024
35f58ac
[TT-13658] added missing logger from provider initialisation (#6729)
andrei-tyk Nov 28, 2024
8bd75f0
[TT-13439] update response content-length when response body is modif…
jeffy-mathew Dec 2, 2024
b0206d2
[TT-13670] Decouple OAuthManager behind interface (#6735)
titpetric Dec 2, 2024
7fbd718
[TT-13390] Silently skip loading bundle on managment node (#6739)
jeffy-mathew Dec 4, 2024
3162814
[TT-13669] Add pre-commit, pre-push hooks (#6733)
jeffy-mathew Dec 4, 2024
7fc67f7
[TT-13142] Fix panic when detailed analytics is turned on with SSE st…
jeffy-mathew Dec 5, 2024
e805241
[TT-13695] Testing fixes, skip dangerous tests (#6736)
titpetric Dec 5, 2024
ff3679e
[testing/gha] Cache is handled by setup/go, this blocks (#6749)
titpetric Dec 6, 2024
178848d
[DX-1423] Update TYK_GW_SECRETS definition (#6360)
dcs3spp Dec 6, 2024
9439737
[TT-12775] Request size limit breaks GET and DELETE requests (#6734)
buraksezer Dec 9, 2024
9c5a43b
[TT-12775] Add request size limit test for POST, PUT and PATCH method…
buraksezer Dec 9, 2024
4af6152
[TT-12710]deleting All Partitioned Policies a Key is linked to does n…
andrei-tyk Dec 11, 2024
9916296
[TT-13155] Explicitly copy BaseMiddleware for each middleware that ta…
titpetric Dec 12, 2024
abc3fa6
TT-13513 TT-12767 TT-12768 ensure to save oauth clients locally when …
sredxny Dec 12, 2024
accfde0
[TT-13715] Upgrade to Bento v1.4.0 (#6762)
buraksezer Dec 12, 2024
f48eb98
[TT-13608] Issues with custom scalar in query variable (#6766)
buraksezer Dec 12, 2024
524a6b6
[TT-13217] Add updated dockerfile for python, test with 5.3.0/5.3.6-r…
titpetric Dec 13, 2024
1b2df0e
[TT-13021]Transfer encoding fix (#6770)
andrei-tyk Dec 16, 2024
2887a4a
[TT-11711] Fix listenpath validation (#6772)
titpetric Dec 16, 2024
2df5817
[TT-12495] Add support for RSASSA-PSS signed JWTs (#6368)
sedkis Dec 17, 2024
1deb1e6
[TT-13021], fixed missing lines (#6787)
andrei-tyk Dec 18, 2024
51e50c3
[TT-13753] Fix sonarcloud coverage via upload-artifact (#6790)
titpetric Dec 19, 2024
d59ae8c
[TT-12741] Looped ap is wrongfully inherit the caller's authenticatio…
buraksezer Dec 19, 2024
3a9b536
[TT-13741] [master] exp/modcheck: Update go.mod dependencies (#6794)
buger Dec 19, 2024
465d3ac
[TT-13564] Add classic to OAS translation guide (#6774)
jeffy-mathew Dec 20, 2024
d46c967
[TT-13742] Update swagger to 5.7.1 (#6803)
lghiur Dec 20, 2024
0276c06
[TT-13761] add batch request to the latest open api specs (#6797)
yurisasuke Dec 22, 2024
f65d41a
Merging to master: Merging to release-5.3: [TT-13769] Extend plugin c…
buger Dec 31, 2024
acb2e19
[TT-13766] Bump newrelic dependency (#6809)
titpetric Jan 3, 2025
1d1ba4e
rebase the PR and fixed merge conflicts
Jan 7, 2025
1c320f7
refactor access logs and tests
Oct 15, 2024
5f3448d
fixed merge conflicts with rebase
Jan 7, 2025
2319ba9
fix merge conflicts and local branch
Jan 7, 2025
af3465b
fix linter issues and test cases
Jan 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
176 changes: 129 additions & 47 deletions .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,74 @@ env:
PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION: python

jobs:
golangci-lint:
runs-on: ubuntu-latest
if: ${{ !github.event.pull_request.draft }}
steps:
- name: "Checkout PR"
uses: TykTechnologies/github-actions/.github/actions/checkout-pr@main
with:
token: ${{ secrets.ORG_GH_TOKEN }}

- name: "Get base ref"
run: |
git fetch origin ${{ github.base_ref }}
git rev-parse origin/${{ github.base_ref }}

- name: Setup Golang
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache-dependency-path: go.sum

- name: Cache
uses: actions/cache@v4
with:
path: |
~/.cache/golangci-lint
key: 'golangci-lint-${{ runner.os }}-${{ hashFiles(''**/go.sum'') }}'
restore-keys: |
golangci-lint-${{ runner.os }}-

- name: Setup CI Tooling
uses: shrink/actions-docker-extract@v3
with:
image: tykio/ci-tools:latest
path: /usr/local/bin/golangci-lint
destination: /usr/local/bin

- run: golangci-lint version && golangci-lint cache status

- name: golangci-lint
if: ${{ github.event_name == 'pull_request' }}
run: |
golangci-lint run --out-format colored-line-number,checkstyle:golangci-lint-report.json --issues-exit-code=0 --new-from-rev=origin/${{ github.base_ref }} -v ./...

- name: golangci-lint-on-push
if: ${{ github.event_name == 'push' }}
run: |
golangci-lint run --out-format checkstyle:golangci-lint-report.json --issues-exit-code=0 -v ./...

- uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: golangcilint
retention-days: 1
path: |
golangci-lint-report.json

test:
name: Go ${{ matrix.go-version }} Redis ${{ matrix.redis-version }}
runs-on: ubuntu-latest
if: ${{ !github.event.pull_request.draft }}
needs: golangci-lint
# Runs on is pinned to a version that provides python 3.10.
# See: https://github.com/actions/runner-images?tab=readme-ov-file#available-images
# Avoid using ubuntu-latest as it would upgrade python unattended.
runs-on: ubuntu-22.04
strategy:
fail-fast: true
# This workflow isn't designed to be run as a pipeline, several issues:
#
# - contains golangci-lint jobs, sonarcloud (would duplicate)
# - cache config not suitable for multiple pipelines
# - python tests should be separate job, or no job
#
# Keep it to a single job run from the matrix as configured
# until we get a chance to redesign the pipeline properly.
fail-fast: false
matrix:
redis-version: [7]
python-version: ["3.11"]
go-version: [1.22.x]

env:
Expand All @@ -53,15 +105,18 @@ jobs:
with:
ref: ${{ github.event.pull_request.head.ref }}

- name: Setup Golang
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}

# Regardless that the base image provides a python release, we need
# setup-python so it properly configures the python3-venv.
- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
python-version: ${{ env.PYTHON_VERSION }}

- name: Print runtime python version
run: python3 -c 'import sys; print("%d.%d" % (sys.version_info[0], sys.version_info[1]))'

- name: Print runtime pip version
run: pip -V && pip3 -V

- name: Setup CI Tooling
uses: shrink/actions-docker-extract@v3
Expand All @@ -70,15 +125,11 @@ jobs:
path: /usr/local/bin/.
destination: /usr/local/bin

- name: Cache
uses: actions/cache@v4
- name: Setup Golang
uses: actions/setup-go@v5
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-${{ hashFiles('**/go.sum') }}
go-version-file: go.mod
cache-dependency-path: go.sum

- name: Install Dependencies and basic hygiene test
id: hygiene
Expand Down Expand Up @@ -109,33 +160,64 @@ jobs:
exit 1
fi

- name: Fetch base branch
if: ${{ github.event_name == 'pull_request' }}
run: git fetch origin ${{ github.base_ref }}

- name: Print CPU info
run: grep '^model name' /proc/cpuinfo
- name: Bring up test services
run: task services:up

- name: Print Go env
run: go env
- name: Preflight Python tests
if: runner.debug == '1'
run: TYK_LOGLEVEL=debug go test -p 1 -parallel 1 -race -v ./dlpython ./coprocess/...

- name: Run Gateway Tests
id: ci-tests
run: |
task test:e2e-combined args="-race -timeout=15m"
task test:coverage

# golangci-lint actions *require* issues-exit-code=0 to pass data along to sonarcloud
# rather than erroring out on github issues directly with out-format github.
- name: golangci-lint
if: ${{ github.event_name == 'pull_request' }}
run: |
golangci-lint run --out-format checkstyle --issues-exit-code=0 --new-from-rev=origin/${{ github.base_ref }} ./... > golanglint.xml
- uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: coverage
retention-days: 1
path: coverage/gateway-all.cov

- name: golangci-lint-on-push
if: ${{ github.event_name == 'push' }}
run: |
golangci-lint run --out-format checkstyle --issues-exit-code=0 ./... > golanglint.xml
- uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: testjson
retention-days: 1
path: coverage/gateway-all.json

sonar-cloud-analysis:
runs-on: ubuntu-latest
if: ${{ !github.event.pull_request.draft }}
needs: [test, golangci-lint]
steps:
- name: "Checkout repository"
uses: TykTechnologies/github-actions/.github/actions/checkout-pr@main
with:
token: ${{ secrets.ORG_GH_TOKEN }}

- name: Download coverage artifacts
uses: actions/download-artifact@v4
with:
name: coverage

- name: Download golangcilint artifacts
uses: actions/download-artifact@v4
with:
name: golangcilint

- name: Check reports existence
id: check_files
uses: andstor/file-existence-action@v3
with:
files: 'gateway-all.cov, golangci-lint-report.json'
fail: true

- name: Install Dependencies
env:
TOKEN: '${{ secrets.ORG_GH_TOKEN }}'
run: git config --global url."https://${TOKEN}@github.com".insteadOf "https://github.com"

- name: SonarCloud Scan
if: always()
Expand All @@ -145,12 +227,12 @@ jobs:
-Dsonar.organization=tyktechnologies
-Dsonar.projectKey=TykTechnologies_tyk
-Dsonar.sources=.
-Dsonar.exclusions=**/testdata/*,test/**,coprocess/**/*,ci/**,smoke-tests/**,apidef/oas/schema/schema.gen.go
-Dsonar.exclusions=**/testdata/*,test/**,coprocess/**/*,ci/**,smoke-tests/**,apidef/oas/schema/schema.gen.go,templates/**
-Dsonar.coverage.exclusions=**/*_test.go,**/mock/*
-Dsonar.test.inclusions=**/*_test.go
-Dsonar.tests=.
-Dsonar.go.coverage.reportPaths=coverage/gateway-all.cov
-Dsonar.go.golangci-lint.reportPaths=golanglint.xml
-Dsonar.go.coverage.reportPaths=gateway-all.cov
-Dsonar.go.golangci-lint.reportPaths=golangci-lint-report.json
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
5 changes: 3 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ concurrency:
jobs:
analyze:
name: Analyze
if: ${{ !github.event.pull_request.draft }}
runs-on: ubuntu-latest

strategy:
Expand All @@ -31,7 +32,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
Expand All @@ -43,7 +44,7 @@ jobs:
if: ${{ github.event_name == 'pull_request' }}

- name: Install Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version-file: go.mod

Expand Down
10 changes: 3 additions & 7 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@
---
name: CI lint

# API Changes (godoc) and JIRA validation only apply to PRs.
# Branches are not important, supports chaining PRs.

on:
pull_request:
branches:
- master
- release-**
push:
branches:
- master
- release-**

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
42 changes: 40 additions & 2 deletions .github/workflows/plugin-compiler-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
- master
- release-**
tags:
- 'v*'
- "v*"

env:
GOLANG_CROSS: 1.22-bullseye
Expand All @@ -20,11 +20,17 @@ concurrency:
jobs:
docker-build:
runs-on: ubuntu-latest
if: ${{ !github.event.pull_request.draft }}
permissions:
id-token: write
steps:
- name: "Reclaim some runner space"
run: sudo rm -rf /usr/local/bin/* /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Configure AWS Credentials
id: configure-aws
Expand Down Expand Up @@ -74,3 +80,35 @@ jobs:
BASE-IMAGE=tykio/golang-cross:${{ env.GOLANG_CROSS }}
GITHUB_SHA=${{ github.sha }}
GITHUB_TAG=${{ github.ref_name }}

- name: Set docker metadata EE
id: set-metadata-ee
uses: docker/metadata-action@v4
with:
images: |
tykio/tyk-plugin-compiler-ee,enable=${{ startsWith(github.ref, 'refs/tags') }}
${{ steps.login-ecr.outputs.registry }}/tyk-plugin-compiler-ee
labels: |
org.opencontainers.image.title=tyk-plugin-compiler-ee
org.opencontainers.image.description=Plugin compiler for the Tyk API Gateway Enterprise Edition
tags: |
type=ref,event=pr
type=semver,pattern=v{{version}}
type=semver,pattern=v{{major}}.{{minor}}
type=semver,pattern={{raw}}
type=sha,format=long

- name: Build and push to dockerhub/ECR EE
uses: docker/build-push-action@v4
with:
context: .
file: ci/images/plugin-compiler/Dockerfile
platforms: linux/amd64
push: true
labels: ${{ steps.set-metadata-ee.outputs.labels }}
tags: ${{ steps.set-metadata-ee.outputs.tags }}
build-args: |
BASE-IMAGE=tykio/golang-cross:${{ env.GOLANG_CROSS }}
GITHUB_SHA=${{ github.sha }}
GITHUB_TAG=${{ github.ref_name }}
BUILD_TAG=ee
Loading
Loading