Skip to content

Commit

Permalink
Version 2.0.0 - Vault Support
Browse files Browse the repository at this point in the history
### Changed

- Pip installation now requires you to specify optional dependencies with either
  `pip install fidelius[aws]` for AWS Parameter Store support,
  `pip install fidelius[vault]` for Hashicorp Vault support or
  `pip install fidelius[aws,vault]` for both.
  • Loading branch information
CCP-Zeulix committed Nov 4, 2024
1 parent bf0da88 commit 3a6e49f
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 12 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).


## [2.0.0] - 2024-11-04

### Changed

- Pip installation now requires you to specify optional dependencies with either
`pip install fidelius[aws]` for AWS Parameter Store support,
`pip install fidelius[vault]` for Hashicorp Vault support or
`pip install fidelius[aws,vault]` for both.


## [2.0.0-dev.1] - 2024-05-16

### Added
Expand Down
2 changes: 1 addition & 1 deletion fidelius/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '2.0.0-dev.1'
__version__ = '2.0.0'

__author__ = 'Thordur Matthiasson <[email protected]>'
__license__ = 'MIT License'
Expand Down
21 changes: 14 additions & 7 deletions fidelius/gateway/paramstore/_paramstorerepo.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,27 @@
from fidelius.structs import *
from fidelius.gateway._abstract import *


import boto3
import os

import logging
log = logging.getLogger(__name__)

try:
import boto3
except ImportError:
log.error('You are trying to use the AwsParamStoreRepo without boto3 installed.')
log.error('Please amend your pip install to `fidelius[aws]` to include boto3 dependencies.')
raise


class AwsParamStoreRepo(_BaseFideliusRepo):
def __init__(self, app_props: FideliusAppProps,
aws_access_key_id: str = None,
aws_secret_access_key: str = None,
aws_key_arn: str = None,
aws_region_name: str = None,
aws_endpoint_url: str = None,
aws_access_key_id: Optional[str] = None,
aws_secret_access_key: Optional[str] = None,
aws_key_arn: Optional[str] = None,
aws_region_name: Optional[str] = None,
aws_endpoint_url: Optional[str] = None,
aws_profile_name: Optional[str] = None,
flush_cache_every_time: bool = False,
**kwargs):
"""Fidelius Admin Repo that uses AWS' Simple Systems Manager's Parameter Store as a back end.
Expand All @@ -45,6 +51,7 @@ def __init__(self, app_props: FideliusAppProps,
testing and development, e.g. by spinning up a
LocalStack container and pointing to that
instead of a live AWS environment.
:param aws_profile_name: ....add this @TODO
:param flush_cache_every_time: Optional flat that'll flush the entire
cache before every operation if set to
True and is just intended for testing
Expand Down
10 changes: 8 additions & 2 deletions fidelius/gateway/vault/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@
]
from fidelius.structs import *
from ._structs import *
import hvac


import logging
log = logging.getLogger(__file__)


try:
import hvac
except ImportError:
log.error('You are trying to use the VaultKeyValRepo without hvac installed.')
log.error('Please amend your pip install to `fidelius[vaulst]` to include hvac dependencies.')
raise


class VaultGateway:
def __init__(self, url: str, token: str, verify: bool = True, timeout: int = 30, namespace: Optional[str] = None):
self._client = hvac.Client(url=url, token=token, verify=verify, timeout=timeout, namespace=namespace)
Expand Down
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,13 @@ classifiers = [
]
dependencies = [
"ccptools >=1.1, <2",
"boto3 >=1.20, <2",
"havc >= 2.2, <3"
]

[project.optional-dependencies]
vault = ["havc >= 2.2, <3"]
aws = ["boto3 >=1.20, <2"]


[project.urls]
Homepage = "https://github.com/ccpgames/fidelius"
Documentation = "https://github.com/ccpgames/fidelius/blob/main/README.md"
Expand Down

0 comments on commit 3a6e49f

Please sign in to comment.