Giter VIP home page Giter VIP logo

vault-minecraft's Introduction

Providing access and secrets in Minecraft using HashiCorp Vault

Prerequisites

In order to run this demo locally you will need the following things installed.

  • Java 17+ (Minecraft is built in Java, so the JDK is required)
  • Shipyard (The environment is built using Shipyard)
  • Docker (The environment runs entirely on top of Docker)

The project is set up using Visual Studio Code and uses Fabric to extend Minecraft. To set up your preferred editor to run the project, please check the Fabric docs.

Setup

To start the environment, from the root directory of the project run:

shipyard run ./shipyard

After the environment setup is completed, you can view the Vault UI in your browser at http://localhost:8200.

To use the Vault CLI, first run the following command, which will set the required environment variables to point at the just created Vault instance.

eval $(shipyard env)

Check out shipyard/main.hcl and shipyard/policies/*.hcl for more details on the created paths and policies in the environment.

Run Minecraft in dev mode

In order to test out the mod in dev mode, you do not need to have Minecraft installed, you simply have to run the Minecraft Client in debug mode using your preferred editor.

Run the mod on your Minecraft client

In order to run the mod on your own Minecraft client, you will need to have the Fabric launcher installed (1.19.2). You need to build the mod using:

./gradlew build

Then copy the resulting jar file (e.g. vault-1.0.0.jar from build/libs/ to your Minecraft mods folder.

The code

The main functionality of the mod can be found in the following paths.

The keycard

The keycard is the item that the identity and data is written to, which can then be used on a lock to gain access.

src/main/java/com/hashicorp/vault/item/CardItem.java

The wrench

In order to configure the dispenser and lock you can use a wrench on them, which will display a config screen.

src/main/java/com/hashicorp/vault/item/WrenchItem.java

The dispenser

The dispenser creates the identity and writes the data to the keycard.

src/main/java/com/hashicorp/vault/block/DispenserBlock.java
src/main/java/com/hashicorp/vault/block/entity/DispenserEntity.java

The lock

The lock checks the identity and data on the keycard and if everything is correct emits a redstone signal.

src/main/java/com/hashicorp/vault/block/LockBlock.java
src/main/java/com/hashicorp/vault/block/entity/LockEntity.java

vault-minecraft's People

Contributors

modmuss50 avatar asiekierka avatar upcraftlp avatar sfplayer1 avatar shnupbups avatar 13rac1 avatar technici4n avatar geolykt avatar r4j4h avatar stonelabs avatar nerdthened avatar nikkyai avatar prospector avatar qwinci avatar selebrator avatar ytg1234 avatar pannoniae avatar ap-1 avatar i509vcb avatar jackassmc avatar zml2008 avatar

Stargazers

Merlin Unterfinger avatar

Watchers

Erik Veld 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.