Giter Site home page Giter Site logo

fakta's Introduction

Fakta

A Consul and Vault F# API.

The aim is to support both Consul and Vault from the same library, because it's a common deployment scenario. You should be able to use the Consul bits without using the Vault bits.

Fakta is Swedish for 'facts', a fitting name for a library interacting with a CP-oriented fact store.

Sponsored by qvitoo โ€“ A.I. bookkeeping.

API

How much has been implemented? This API surface is the same as that of the official Go client.

Those not implemented will throw a correspond TBD-exception.

Justification

The current implementation's use-case (for me) is leader-election and semi- to long-term storage of access keys that need be requested exactly-once or they get invalidated.

Together with Registrator and this library, F# code can participate in micro- service architectures easily.

Compiling and running initial tests

First, run:

./tools/consul.sh agent -dev -bind 127.0.0.1 -config-file=server.json

Then in another terminal:

bundle exec rake

Which will call xbuild/msbuild and compile the project, run unit tests and then finally run the integration tests.

Milestones

All Milestones

Prio 1 is what is needed to get a PoC up and running. Prio 2 is next, by being good to have. Prio 3 is next.

The order of Consul vs Vault priorities is:

  • Vault Prio 1
  • Consul Prio 1
  • Vault Prio 2
  • Consul Prio 2
  • etc

Note that Vault is on top, because all the Prio 0's of Consul are already done.

References

Consul

Vault

  • clone
  • create
  • destroy
  • info
  • list
  • update
  • checkRegister
  • checkDeregister
  • checks
  • enableNodeMaintenance
  • disableNodeMaintenance
  • enableServiceMaintenance
  • disableServiceMaintenance
  • join
  • members
  • self
  • serviceRegister
  • serviceDeregister
  • nodeName
  • services
  • passTTL
  • warnTTL
  • failTTL
  • forceLeave
  • datacenters
  • node
  • nodes
  • deregister
  • register
  • service
  • services
  • fire
  • list
  • idToIndex
  • checks
  • node
  • state
  • service
  • acquire
  • CAS
  • delete
  • deleteCAS
  • deleteTree
  • getRaw
  • get
  • keys
  • list
  • put
  • release
  • create
  • createNoChecks
  • destroy
  • info
  • list
  • node
  • renew
  • renewPeriodic
  • leader
  • peers

Service

Helping Out

All development is done on master branch which should always be release-able; write unit tests for your changes and it shall be fine.

Running local instance of Consul

  1. enable ACL support by creating json config file "server.json" looking like this:
{
 "bootstrap": false,
 "server": true,
 "datacenter": "ams1",
 "encrypt": "yJqVBxe12ZfE3z+4QSk8qA==",
 "log_level": "INFO",
 "acl_datacenter": "ams1",
 "acl_default_policy": "allow",
 "acl_master_token": "secret",
 "acl_token": "secret"
}
  1. run consul agent with:
consul agent -dev -bind 127.0.0.1 -config-file=path to server.json
  1. Open http://localhost:consul_port/ui/#/ams1/acls (typically http://127.0.0.1:8500/ui/#/ams1/acls ) and create token called the same like the master token in config file

Running local instance of Consul

  1. create config file (do not use this in production)
backend "file" {
  path = "vault"
}

listener "tcp" {
  tls_disable = 1
}

disable_cache = true
disable_mlock = true
  1. run vault server with vault server -config=config_file_name.conf
  2. you have to restart your local vault server and delete vault directory contents everytime you want to re-run tests.

Compiling

You compile with Rake/albacore, the best build system for .Net/mono:

bundle
bundle exec rake

Running Tests

The unit tests are run by just running the Tests-executable, or by using rake:

bundle exec rake tests:unit

Running Integration Tests

You'll need to start consul first; in one console:

bundle exec foreman start

...and then running the tests:

bundle exec rake tests:integration

fakta's People

Contributors

leia avatar haf avatar davidpodhola avatar ladyleia avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.