Implements a basic REST Web-service for validating IBAN account numbers in GO.
Switch branches/tags
Nothing to show
Clone or download
fourcube Merge pull request #25 from fourcube/issue-23-run-docker-service-as-n…
…on-root

Run openiban docker service as non-root user (fixes #23)
Latest commit 77a61af Sep 4, 2018
Permalink
Failed to load latest commit information.
k8s Add kubernetes deployment May 25, 2018
metrics support build without metrics (go <1.8) Oct 12, 2017
static Add self hosting link to start page May 18, 2018
test Initial commit. Aug 15, 2014
.gitignore Add build script May 15, 2018
Dockerfile Run openiban docker service as non-root user (fixes #23) Sep 4, 2018
LICENSE
Makefile
README.md Merge pull request #21 from JeffreyVdb/features-kubernetes Jun 4, 2018
build.sh Correct path inside build archives May 16, 2018
country_code_handler.go
country_code_handler_test.go Add IBAN calculation Jan 7, 2016
goiban_service.go Update readme, allow setting of staticPath May 15, 2018
goiban_service_test.go Add standalone hosting support May 15, 2018
iban_generation.go
iban_generation_test.go

README.md

goiban-service

Service Shutdown Notice

The openiban API will cease operation on the 24th of May, 10 p.m. GMT.

You can read more about it at https://openiban.com.

Important: I will continue to maintain the goiban-service repository.


Implements a basic REST Web-service for validating IBAN account numbers in GO. Uses the logic from http://github.com/fourcube/goiban. Deployed at http://openiban.com .

Running the service

Via go get:

$ go get -u github.com/fourcube/goiban-service
# Launch the service listening on port 8080 and serve static content
$ $GOPATH/bin/goiban-service -port 8080 -w 

Download a binary package:

A list of all releases is available here.

# Make sure to choose the correct operating system and architecture
$ curl -Lo goiban-service.tar.gz "https://github.com/fourcube/goiban-service/releases/download/v1.0.0/goiban-service-linux-386.tar.gz"
$ tar -xzf goiban-service.tar.gz
$ cd goiban-service
# Launch the service listening on port 8080, using the bank data from ./data and serving
# the web interface from ./static
$ ./goiban-service -dataPath ./data -staticPath ./static -port 8080 -w

Via Docker

https://hub.docker.com/r/fourcube/openiban/


$ docker run --name openiban -d -p8080:8080 fourcube/openiban
$ curl localhost:8080/validate/DE89370400440532013000

You will see something like:

{
  "valid": true,
  "messages": [],
  "iban": "DE89370400440532013000",
  "bankData": {
    "bankCode": "",
    "name": ""
  },
  "checkResults": {}
}

Via Kubernetes

You can deploy above docker file in your kubernetes cluster by using the configuration files container in ./k8s.

Run the following command to apply the deployment and service (NodePort service running on port 32111)

kubectl apply -f ./k8s

Building the service (MySQL)

You have to install go >= 1.8, setup your GOPATH and install a MySQL server. Goiban requires a database called 'goiban'. The following commands assume a MySQL database running on localhost:3306 with database goiban and user root with password root.

$ go get -u github.com/fourcube/goiban-data-loader
$ cd $GOPATH/src/github.com/fourcube/goiban-data-loader
$ DATABASE_URL="root:root@tcp(localhost:3306)/goiban?charset=utf8" make migrate

# load data
$ go build
$ ./goiban-data-loader bundesbank root:root@/goiban?charset=utf8

$ go get github.com/fourcube/goiban-service
$ cd $GOPATH/src/github.com/fourcube/goiban-service
$ go build
$ ./goiban-service -port 8080 -dbURL root:root@/goiban?charset=utf8

To create a build without the metrics support (e.g if you run on go < 1.8) run:

$ go build -tags no_metrics

MySQL development instance

To quickly run a MySQL database inside a docker container you can use the following command:

docker run -d --name openiban-mysql -p3306:3306 -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=goiban mysql

Client Libraries

Name Language
openiban.js ⭐️ JavaScript/TypeScript
OpenIBAN Python
OpenIban Connector PHP (Plugin for Shopware)

⭐️ officially supported

The MIT License (MIT)

Copyright (c) 2013-2017 Chris Grieger

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.