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

TH2-4934 #15

Open
wants to merge 12 commits into
base: dev-version-2
Choose a base branch
from
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM gradle:7.5-jdk11 AS build
FROM gradle:7.6-jdk11 AS build
ARG release_version
COPY ./ .
RUN gradle --no-daemon clean build dockerPrepare -Prelease_version=${release_version}
Expand Down
47 changes: 28 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# HTTP Codec v0.2.0
# HTTP Codec v0.4.0

This microservice can encode and decode HTTP messages

Expand Down Expand Up @@ -27,32 +27,33 @@ This codec processes parsed messages with `http` protocol in metadata field
1. HTTP message - `Message` with `Request` or `Response` type (protocol = `http`)
2. HTTP message body - `RawMessage` with a raw message body (if present)

If decoded message was an HTTP request, message body metadata would contain `method` and `uri` properties with HTTP request method name and URI respectively
If decoded message was an HTTP request, message body metadata would contain `method` and `uri` properties with HTTP
request method name and URI respectively

## Message types

* Request

|Field|Type|Description|
|:---:|:---:|:---:|
|method|String|HTTP method name (e.g. GET, POST, etc.)|
|uri|String|Request URI (e.g. /some/request/path?param1=value1&param2=value2...)|
|headers|List\<Header>|HTTP headers (e.g. Host, Content-Length, etc.)|
| Field | Type | Description |
|:-------:|:-------------:|:--------------------------------------------------------------------:|
| method | String | HTTP method name (e.g. GET, POST, etc.) |
| uri | String | Request URI (e.g. /some/request/path?param1=value1&param2=value2...) |
| headers | List\<Header> | HTTP headers (e.g. Host, Content-Length, etc.) |

* Response

|Field|Type|Description|
|:---:|:---:|:---:|
|statusCode|String|HTTP status code (e.g. 200, 403, 500, etc)|
|reason|String|HTTP status reason (e.g. OK, Forbidden, Internal Server Error, etc.)|
|headers|List\<Header>|HTTP headers (e.g. Set-Cookie, Content-Length, etc.)|
| Field | Type | Description |
|:----------:|:-------------:|:--------------------------------------------------------------------:|
| statusCode | String | HTTP status code (e.g. 200, 403, 500, etc) |
| reason | String | HTTP status reason (e.g. OK, Forbidden, Internal Server Error, etc.) |
| headers | List\<Header> | HTTP headers (e.g. Set-Cookie, Content-Length, etc.) |

* Header

|Field|Type|Description|
|:---:|:---:|:---:|
|name|String|HTTP header name|
|value|String|HTTP header value|
| Field | Type | Description |
|:-----:|:------:|:-----------------:|
| name | String | HTTP header name |
| value | String | HTTP header value |

## Deployment via `infra-mgr`

Expand Down Expand Up @@ -120,15 +121,23 @@ spec:
```

### Gradle metadata note
ignoreGradleMetadataRedirection is used for sonatype because Sailfish dependencies have constrains that interfere with BOM,
so we exclude Gradle metadata for these repositories.

It's been verified that Sailfish itself is compatible with versions from BOM and therefore safe to use.
ignoreGradleMetadataRedirection is used for sonatype because Sailfish dependencies have constrains that interfere with
BOM, so we exclude Gradle metadata for these repositories.

It's been verified that Sailfish itself is compatible with versions from BOM and therefore safe to use.

# Release notes

## 0.4.0

+ th2 transport protocol support
+ Updated bom:4.4.0
+ Updated common:5.3.0
+ Updated codec:5.3.0

## 0.3.0

* th2-common upgrade to `3.44.0`
* th2-bom upgrade to `4.1.0`
* th2-codec upgrade to `4.7.6`
Expand Down
61 changes: 33 additions & 28 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,12 @@ plugins {
id 'com.palantir.docker' version '0.25.0'
id 'org.jetbrains.kotlin.jvm' version "${kotlin_version}"
id 'application'
id "org.owasp.dependencycheck" version "7.2.0"
id 'org.jetbrains.kotlin.kapt' version "${kotlin_version}"
}

dependencyCheck {
format='HTML'
failBuildOnCVSS=5
id "org.owasp.dependencycheck" version "8.2.1"
}

ext {
sharedDir = file("${project.rootDir}/shared")
sailfishVersion = '3.3.54'
sailfishVersion = '3.3.111'
}

group = 'com.exactpro.th2'
Expand All @@ -30,11 +24,6 @@ ext.excludeSailfish = { rcd ->
}

repositories {
maven {
name 'MavenLocal'
url sharedDir
}

maven {
name 'Sonatype_snapshots'
url 'https://s01.oss.sonatype.org/content/repositories/snapshots/'
Expand Down Expand Up @@ -75,7 +64,7 @@ repositories {
mavenCentral()
mavenLocal()

configurations.all {
configurations.configureEach {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
resolutionStrategy.cacheDynamicVersionsFor 0, 'seconds'
}
Expand All @@ -96,24 +85,23 @@ jar {
}

dependencies {
api platform('com.exactpro.th2:bom:4.1.0')
api platform("com.exactpro.th2:bom:4.5.0")

implementation "com.exactpro.th2:common:5.4.0-dev"
implementation "com.exactpro.th2:common-utils:2.2.0-dev"
implementation "com.exactpro.th2:codec:5.3.0-new-proto-+"

implementation 'com.exactpro.th2:common:5.1.0-dev-version-5+'
implementation 'com.exactpro.th2:codec:5.0.0-dev-version-5+'
implementation "com.exactpro.th2:sailfish-utils:4.1.0-dev"

implementation 'com.exactpro.th2:sailfish-utils:3.14.0'

compileOnly 'com.google.auto.service:auto-service:1.0.1'
annotationProcessor 'com.google.auto.service:auto-service:1.0.1'
compileOnly "com.google.auto.service:auto-service:1.1.1"
annotationProcessor "com.google.auto.service:auto-service:1.1.1"
kapt "com.google.auto.service:auto-service:1.1.1"

implementation group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib-jdk8', version: kotlin_version
implementation group: 'org.jetbrains.kotlin', name: 'kotlin-reflect', version: kotlin_version
implementation group: 'io.github.microutils', name: 'kotlin-logging', version: '1.7.9'
implementation group: 'com.athaydes.rawhttp', name: 'rawhttp-core', version: '2.4.1'
implementation "io.github.microutils:kotlin-logging:3.0.5"
implementation "com.athaydes.rawhttp:rawhttp-core:2.4.1"

testImplementation group: 'org.jetbrains.kotlin', name: 'kotlin-test-junit5', version: kotlin_version
testImplementation 'org.junit.jupiter:junit-jupiter:5.9.0'
kapt 'com.google.auto.service:auto-service:1.0.1'
testImplementation "org.jetbrains.kotlin:kotlin-test-junit5"
testImplementation "org.junit.jupiter:junit-jupiter:5.10.0"
}

application {
Expand Down Expand Up @@ -149,3 +137,20 @@ compileTestKotlin {
test {
useJUnitPlatform()
}

configurations {
compileClasspath {
resolutionStrategy.activateDependencyLocking()
}
}

dependencyCheck {
formats = ['SARIF', 'JSON', 'HTML']
failBuildOnCVSS = 5
suppressionFile = file('suppressions.xml')
analyzers {
assemblyEnabled = false
nugetconfEnabled = false
nodeEnabled = false
}
}
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
kotlin.code.style=official
kotlin_version=1.6.21
release_version=0.3.0
kotlin_version=1.8.22
release_version=0.4.0
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#Mon May 25 11:22:24 MSK 2020
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-all.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
Expand Down
Loading