Skip to content

Commit

Permalink
Fix error in the regular expression checks for kv engine (#6)
Browse files Browse the repository at this point in the history
* Fixed regex checks and minor updates
  • Loading branch information
bearlike authored Apr 9, 2022
1 parent 057d7d8 commit 06ab81f
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 18 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
name: Build and deploy multiarch image

on:
schedule:
- cron: '0 10 * * *' # everyday at 10am
push:
branches:
- 'main'
- 'releases/v*'
# branches:
# - 'releases/v*'
tags:
- 'v*'
paths-ignore:
Expand Down Expand Up @@ -39,7 +36,7 @@ jobs:
env:
IMG_NAME: ${{ 'krishnaalagiri/ssm' }}
# Versioning: MAJOR.MINOR.PATCH (eg., 1.2.3)
VERSION_FULL: ${{ '1.1.0' }}
VERSION_FULL: ${{ '1.1.1' }}
# For v1.2.3, VERSION_SHORT is '1.2'
VERSION_SHORT: ${{ '1.1' }}
# For v1.2.3, VERSION_MAJOR is '1'
Expand Down
2 changes: 1 addition & 1 deletion Api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

conn = Connection()
api_v1 = Blueprint("api", __name__, url_prefix="/api")
api = Api(api_v1, version="1.1.0", title="Simple Secrets Manager",
api = Api(api_v1, version="1.1.1", title="Simple Secrets Manager",
description="Secrets management simplified",
authorizations=authorizations)
app = Flask(__name__)
Expand Down
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

FROM python:3.8-slim-buster

LABEL title="Simple Secrets Manager"
LABEL version="1.1.0"
LABEL author.name="Krishnakanth Alagiri"
LABEL author.github="https://github.com/bearlike"
LABEL repository="https://github.com/bearlike/simple-secrets-manager"
LABEL description="Secure storage, and delivery for tokens, passwords, \
LABEL com.ssm.title="Simple Secrets Manager"
LABEL com.ssm.version="1.1.1"
LABEL com.ssm.author.name="Krishnakanth Alagiri"
LABEL com.ssm.author.github="https://github.com/bearlike"
LABEL com.ssm.repo="https://github.com/bearlike/simple-secrets-manager"
LABEL com.ssm.description="Secure storage, and delivery for tokens, passwords, \
API keys, and other secrets."

WORKDIR /app
Expand Down
2 changes: 1 addition & 1 deletion Engines/kv.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def get(self, path, key):

def add(self, path, key, value):
pattern = "[a-zA-Z0-9_]+"
if not (re.fullmatch(pattern, key) and re.fullmatch(pattern, value)):
if not (re.fullmatch(pattern, key) and re.fullmatch(pattern, path)):
return {"status": f"Key and/or Path does not match {pattern}"}
finder = self._kv.find_one({"path": path})
if finder is None:
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<a href="https://hub.docker.com/r/krishnaalagiri/ssm"><img alt="Docker Image Latest Version" src="https://img.shields.io/docker/v/krishnaalagiri/ssm?logo=docker&sort=semver"></a>
<a href="https://hub.docker.com/r/krishnaalagiri/ssm"><img alt="Docker Image Architecture" src="https://img.shields.io/badge/architecture-arm64v8%20%7C%20x86__64-blue?logo=docker"></a>
<a href="https://github.com/bearlike/simple-secrets-manager/actions/workflows/ci.yml"><img alt="GitHub Repository" src="https://img.shields.io/github/workflow/status/bearlike/simple-secrets-manager/Build%20and%20deploy%20multiarch%20image?logo=github"></a>
<a href="https://github.com/bearlike/simple-secrets-manager"><img alt="GitHub Repository" src="https://img.shields.io/badge/GitHub-bearlike%2Fsimple--secrets--manager-blue?logo=github"></a>
<a href="/LICENSE"><img alt="License" src="https://img.shields.io/github/license/bearlike/simple-secrets-manager"></a>
</p>

Expand Down Expand Up @@ -36,7 +35,7 @@ Hashi Corp Vault works well but it was meant for enterprises. Therefore, it was

## Getting started
### Automated Install: [`docker-compose`](https://docs.docker.com/compose/install/) (Recommended)
1. Run the [stack](https://github.com/bearlike/simple-secrets-manager/blob/main/docker-compose.yml) by executing `docker-compose up -d`.
1. Run the [stack](docker-compose.yml) by executing `docker-compose up -d`.

### Manual Install
1. Clone our repository and run
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# $ docker login -u <username>
#
# We try to follow [SemVer v2.0.0](https://semver.org/)
VERSION="1.0.0"
VERSION="1.1.1"
# If $VERSION = "1.2.3"
# ${VERSION::3} will be "1.2"
# ${VERSION::1} will be "1"
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ services:

app:
image: krishnaalagiri/ssm:latest
restart: always
depends_on:
- mongo
ports:
Expand Down
3 changes: 2 additions & 1 deletion docs/README_dockerhub.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ Secure storage, and delivery for tokens, passwords, API keys, and other secrets

## Supported tags and respective [Dockerfile](https://github.com/bearlike/simple-secrets-manager/blob/main/Dockerfile) links
- [`1.1.0`, `1.1`, `1`, `latest`](https://github.com/bearlike/simple-secrets-manager/blob/releases/v1.1.0/Dockerfile)
- [`1.1.1`, `1.1`, `1`, `latest`](https://github.com/bearlike/simple-secrets-manager/blob/releases/v1.1.1/Dockerfile)
- [`1.1.0`](https://github.com/bearlike/simple-secrets-manager/blob/releases/v1.1.0/Dockerfile)
- [`1.0.0`, `1.0`](https://github.com/bearlike/simple-secrets-manager/blob/releases/v1.0.0/Dockerfile)


Expand Down

0 comments on commit 06ab81f

Please sign in to comment.