Skip to content
This repository has been archived by the owner on May 6, 2021. It is now read-only.

Commit

Permalink
Implement #17 Fetch public keys from auth service (#23)
Browse files Browse the repository at this point in the history
Implement #17 by getting the keys from the auth service.

Most of the code and tests has been imported from fabric8-tenant

A few things has been added along this.

* .gitignore improvements
* add a db-auth to run in docker and change port for the default db
* add a makefile docker-run target to get all the docker stuff up
* Improve tests
  • Loading branch information
chmouel authored Oct 16, 2018
1 parent 4517f16 commit 44e4e69
Show file tree
Hide file tree
Showing 23 changed files with 1,674 additions and 45 deletions.
34 changes: 33 additions & 1 deletion .cico/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ function _deploy() {
echo 'CICO: Image pushed, ready to update deployed app'
}


function deploy() {
set +e
_deploy || fail=true
Expand All @@ -98,13 +99,44 @@ function deploy() {
fi
}

function check_up() {
service=$1
host=$2
port=$3
max=30 # 1 minute

counter=1
while true;do
python -c "import socket;s = socket.socket(socket.AF_INET, socket.SOCK_STREAM);s.connect(('$host', $port))" \
>/dev/null 2>/dev/null && break || \
echo "CICO: Waiting that $service on ${host}:${port} is started (sleeping for 2)"

if [[ ${counter} == ${max} ]];then
echo "CICO: Could not connect to ${service} after some time"
echo "CICO: Investigate locally the logs with fig logs"
exit 1
fi

sleep 2

(( counter++ ))
done
}

function dotest() {
cd ${REPO_PATH}

make build

make docker-run

check_up postgres-build 127.0.0.1 5433
check_up postgres-auth 127.0.0.1 5434
check_up auth 127.0.0.1 8089

make test-unit

make analyze-go-code

make coverage

# Upload to codecov
Expand Down
93 changes: 75 additions & 18 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,26 +1,83 @@
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
### Intellij ###
.idea/
*.iws
*.iml
/out/
.idea_modules/
atlassian-ide-plugin.xml

### Eclipse ###
.metadata
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.settings/
.loadpath
.recommenders

# Eclipse Core
.project

# External tool builders
.externalToolBuilders/

# Locally stored "Eclipse launch configurations"
*.launch

# Code Recommenders
.recommenders/


### VisualStudioCode ###
.vscode

### Go ###
# Compiled Object files, Static and Dynamic libs (Shared Objects)
*.o
*.a
*.so
*.dylib
bin

# Test binary, build with `go test -c`
*.test
# Folders
_obj
_test

# Architecture specific extensions/prefixes
*.[568vq]
[568vq].out

*.cgo1.go
*.cgo2.c
_cgo_defun.c
_cgo_gotypes.go
_cgo_export.*

# Output of the go coverage tool, specifically when used with LiteIDE
*.out
_testmain.go

*.exe
*.test
*.prof

# vendored deps are not kept in git
vendor
# Auth specific artifacts
/debug
**/debug.test

# generate goa code
app
swagger
# Auth binaries
bin/

# tmp dir
tmp
# Glide package manager
.glide
vendor/

# Generate assets
# Generated assets
app/
assets/js/
bindata_assetfs.go
client/
swagger/
tool/
migration/sqlbindata.go
environment/generated/
auth/client
90 changes: 76 additions & 14 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ required = [
"github.com/goadesign/goa/encoding/form",
"github.com/goadesign/goa/goagen",
"github.com/goadesign/goa/goagen/codegen",
"github.com/fabric8-services/fabric8-auth/design",
"github.com/goadesign/goa/goagen/gen_app",
"github.com/goadesign/goa/goagen/gen_controller",
"github.com/goadesign/goa/goagen/gen_swagger",
Expand All @@ -48,6 +49,8 @@ required = [

ignored = [
"github.com/fabric8-services/fabric8-build-service/app",
"github.com/fabric8-services/fabric8-tenant/auth/client",
"github.com/fabric8-services/fabric8-tenant/auth"
]

[prune]
Expand All @@ -57,3 +60,9 @@ ignored = [
[[constraint]]
name = "github.com/stretchr/testify"
version = "1.2.1"

[[constraint]]
name = "github.com/dnaeon/go-vcr"
#revision= "9d71b8a6df86e00127f96bc8dabc09856ab8afdb"
source= "https://github.com/xcoulon/go-vcr/"
revision= "fd097d581a47517ee36686adfd3153d6f8eca367"
Loading

0 comments on commit 44e4e69

Please sign in to comment.