Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' of github.com:galasa-dev/extensions into iss1768
Browse files Browse the repository at this point in the history
  • Loading branch information
jadecarino committed Jun 12, 2024
2 parents 41c033c + 940d2d6 commit 6c5e50f
Show file tree
Hide file tree
Showing 14 changed files with 149 additions and 23 deletions.
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
repos:
- repo: https://github.com/ibm/detect-secrets
rev: 0.13.1+ibm.62.dss
hooks:
- id: detect-secrets # pragma: whitelist secret
args: [--baseline, .secrets.baseline, --use-all-plugins, --fail-on-unaudited]
84 changes: 84 additions & 0 deletions .secrets.baseline
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{
"exclude": {
"files": "^.secrets.baseline$",
"lines": null
},
"plugins_used": [
{
"name": "AWSKeyDetector"
},
{
"name": "ArtifactoryDetector"
},
{
"name": "AzureStorageKeyDetector"
},
{
"base64_limit": 4.5,
"name": "Base64HighEntropyString"
},
{
"name": "BasicAuthDetector"
},
{
"name": "BoxDetector"
},
{
"name": "CloudantDetector"
},
{
"ghe_instance": "github.ibm.com",
"name": "GheDetector"
},
{
"name": "GitHubTokenDetector"
},
{
"hex_limit": 3,
"name": "HexHighEntropyString"
},
{
"name": "IbmCloudIamDetector"
},
{
"name": "IbmCosHmacDetector"
},
{
"name": "JwtTokenDetector"
},
{
"keyword_exclude": null,
"name": "KeywordDetector"
},
{
"name": "MailchimpDetector"
},
{
"name": "NpmDetector"
},
{
"name": "PrivateKeyDetector"
},
{
"name": "SlackDetector"
},
{
"name": "SoftlayerDetector"
},
{
"name": "SquareOAuthDetector"
},
{
"name": "StripeDetector"
},
{
"name": "TwilioKeyDetector"
}
],
"results": {},
"version": "0.13.1+ibm.62.dss",
"word_list": {
"file": null,
"hash": null
}
}
38 changes: 37 additions & 1 deletion build-locally.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,16 @@ LOGS_DIR - Optional. Where logs are placed. Defaults to creating a temporary dir
EOF
}

function check_exit_code () {
# This function takes 3 parameters in the form:
# $1 an integer value of the expected exit code
# $2 an error message to display if $1 is not equal to 0
if [[ "$1" != "0" ]]; then
error "$2"
exit 1
fi
}

#-----------------------------------------------------------------------------------------
# Process parameters
#-----------------------------------------------------------------------------------------
Expand Down Expand Up @@ -181,7 +191,8 @@ function build_with_gradle {
${goals}"
info "Using command: $cmd"
$cmd 2>&1 > ${log_file}
rc=$? ; if [[ "${rc}" != "0" ]]; then cat ${log_file} ; error "Failed to build ${project} with gradle." ; exit 1 ; fi
rc=$?
check_exit_code $rc "Failed to build ${project} with gradle."
}

function displayCouchDbCodeCoverage {
Expand All @@ -197,8 +208,33 @@ function displayCouchDbCodeCoverage {
info "See html report here: file://${BASEDIR}/galasa-extensions-parent/dev.galasa.ras.couchdb/build/jacocoHtml/index.html"
}

function check_secrets {
h2 "updating secrets baseline"
cd ${BASEDIR}
detect-secrets scan --update .secrets.baseline
rc=$?
check_exit_code $rc "Failed to run detect-secrets. Please check it is installed properly"
success "updated secrets file"

h2 "running audit for secrets"
detect-secrets audit .secrets.baseline
rc=$?
check_exit_code $rc "Failed to audit detect-secrets."

#Check all secrets have been audited
secrets=$(grep -c hashed_secret .secrets.baseline)
audits=$(grep -c is_secret .secrets.baseline)
if [[ "$secrets" != "$audits" ]]; then
error "Not all secrets found have been audited"
exit 1
fi
sed -i '' '/[ ]*"generated_at": ".*",/d' .secrets.baseline
success "secrets audit complete"
}

clean_maven_repo
build_with_gradle
displayCouchDbCodeCoverage
check_secrets

success "Project ${project} built - OK - log is at ${log_file}"
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
}

dependencies {
implementation 'dev.galasa:dev.galasa.framework:0.34.0'
implementation 'dev.galasa:dev.galasa.framework:0.35.0'
implementation 'dev.galasa:dev.galasa:0.34.0'

implementation 'commons-logging:commons-logging:1.2'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {

description = 'Galasa Authentication - CouchDB'

version = '0.34.0'
version = '0.35.0'

configurations {
implementation.transitive = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import dev.galasa.extensions.common.impl.HttpRequestFactoryImpl;
import dev.galasa.extensions.common.api.HttpRequestFactory;
import dev.galasa.extensions.common.impl.LogFactoryImpl;
import dev.galasa.framework.spi.IFrameworkInitialisation;
import dev.galasa.framework.spi.IApiServerInitialisation;
import dev.galasa.framework.spi.SystemEnvironment;
import dev.galasa.framework.spi.auth.IAuthStoreRegistration;
import dev.galasa.framework.spi.utils.SystemTimeService;
Expand Down Expand Up @@ -53,18 +53,18 @@ public CouchdbAuthStoreRegistration(HttpClientFactory httpClientFactory, HttpReq
* This method checks that the auth store is a remote URL reference, and if true
* registers a new couchdb auth store as the only auth store.
*
* @param frameworkInitialisation Parameters this extension can use to to
* @param apiServerInitialisation Parameters this extension can use to to
* initialise itself.
* @throws AuthStoreException if there was a problem accessing the auth store.
*/
@Override
public void initialise(IFrameworkInitialisation frameworkInitialisation) throws AuthStoreException {
public void initialise(IApiServerInitialisation apiServerInitialisation) throws AuthStoreException {

URI authStoreUri = frameworkInitialisation.getAuthStoreUri();
URI authStoreUri = apiServerInitialisation.getAuthStoreUri();

if (isUriReferringToThisExtension(authStoreUri)) {
try {
frameworkInitialisation.registerAuthStore(
apiServerInitialisation.registerAuthStore(
new CouchdbAuthStore(
authStoreUri,
httpClientFactory,
Expand Down
2 changes: 1 addition & 1 deletion galasa-extensions-parent/dev.galasa.cps.etcd/bnd.bnd
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Import-Package: \
javax.security.cert
Embed-Transitive: true
Embed-Dependency: *;scope=compile|runtime
-includeresource: gson-2.9.0.jar; lib:=true,\
-includeresource: gson-2.10.1.jar; lib:=true,\
jetcd-core-0.5.9.jar; lib:=true,\
jetcd-common-0.5.9.jar; lib:=true,\
grpc-core-1.39.0.jar; lib:=true,\
Expand Down
4 changes: 2 additions & 2 deletions galasa-extensions-parent/dev.galasa.cps.etcd/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ plugins {

description = 'Galasa etcd3 for CPS, DSS and Credentials - Provides the CPS, DSS and Credential stores from a etcd3 server'

version = '0.33.0'
version = '0.35.0'

dependencies {
implementation ('io.etcd:jetcd-core:0.5.9')

// Not required for compile, but required to force the download of the jars to embed by bnd
implementation ('com.google.code.gson:gson:2.9.0') {
implementation ('com.google.code.gson:gson:2.10.1') {
force = true
}
implementation ('org.codehaus.mojo:animal-sniffer-annotations:1.19')
Expand Down
2 changes: 1 addition & 1 deletion galasa-extensions-parent/dev.galasa.cps.rest/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {

description = 'Galasa CPS access over http - Provides the CPS stores via the public REST interface over http'

version = '0.34.0'
version = '0.35.0'

dependencies {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {

description = 'Galasa CPS access over http - Provides the CPS stores via the public REST interface over http'

version = '0.34.0'
version = '0.35.0'

dependencies {
implementation ('org.apache.httpcomponents:httpclient-osgi:4.5.13')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {

description = 'Galasa extensions mocks used for tests'

version = '0.34.0'
version = '0.35.0'

configurations {
implementation.transitive = false
Expand All @@ -14,7 +14,7 @@ dependencies {
implementation ('org.apache.httpcomponents:httpclient-osgi:4.5.13')
implementation ('org.apache.httpcomponents:httpcore-osgi:4.4.14')
implementation ('com.google.code.gson:gson:2.10.1')
implementation ('dev.galasa:dev.galasa.framework: 0.33.0')
implementation ('dev.galasa:dev.galasa.framework:0.35.0')
implementation ('junit:junit:4.13.1')
implementation ('org.assertj:assertj-core:3.16.1')
implementation (project(':dev.galasa.extensions.common'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
import dev.galasa.framework.spi.ConfidentialTextException;
import dev.galasa.framework.spi.DynamicStatusStoreException;
import dev.galasa.framework.spi.EventsException;
import dev.galasa.framework.spi.IApiServerInitialisation;
import dev.galasa.framework.spi.ICertificateStoreService;
import dev.galasa.framework.spi.IConfidentialTextService;
import dev.galasa.framework.spi.IConfigurationPropertyStore;
import dev.galasa.framework.spi.IDynamicStatusStore;
import dev.galasa.framework.spi.IEventsService;
import dev.galasa.framework.spi.IFramework;
import dev.galasa.framework.spi.IFrameworkInitialisation;
import dev.galasa.framework.spi.IResultArchiveStoreService;
import dev.galasa.framework.spi.ResultArchiveStoreException;
import dev.galasa.framework.spi.auth.IAuthStore;
Expand All @@ -28,7 +28,7 @@
import java.net.URI;
import java.util.*;

public class MockFrameworkInitialisation implements IFrameworkInitialisation {
public class MockFrameworkInitialisation implements IApiServerInitialisation {

private MockFramework framework;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {

description = 'Galasa RAS - CouchDB'

version = '0.34.0'
version = '0.35.0'

configurations {
implementation.transitive = false
Expand Down
10 changes: 5 additions & 5 deletions release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,31 +14,31 @@ framework:
bundles:

- artifact: dev.galasa.auth.couchdb
version: 0.34.0
version: 0.35.0
obr: true
isolated: true
codecoverage: true

- artifact: dev.galasa.ras.couchdb
version: 0.34.0
version: 0.35.0
obr: true
isolated: true
codecoverage: true

- artifact: dev.galasa.cps.etcd
version: 0.33.0
version: 0.35.0
obr: true
isolated: true
codecoverage: true

- artifact: dev.galasa.cps.rest
version: 0.34.0
version: 0.35.0
obr: true
isolated: true
codecoverage: true

- artifact: dev.galasa.extensions.common
version: 0.34.0
version: 0.35.0
obr: true
isolated: true
codecoverage: true
Expand Down

0 comments on commit 6c5e50f

Please sign in to comment.