Compare commits
No commits in common. "1088164eed239adb52b0776f449fae51ff1ba0c1" and "6e3b48de07c2afd00aaaeef51072ee28c95283f1" have entirely different histories.
1088164eed
...
6e3b48de07
16 changed files with 73 additions and 74 deletions
|
|
@ -1,9 +1,3 @@
|
||||||
## 0.1.0a23 (2025-10-16)
|
|
||||||
|
|
||||||
### Feat
|
|
||||||
|
|
||||||
- update rougail-structural-bitwarden
|
|
||||||
|
|
||||||
## 0.1.0a22 (2025-10-10)
|
## 0.1.0a22 (2025-10-10)
|
||||||
|
|
||||||
### Feat
|
### Feat
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ requires = ["flit_core >=3.8.0,<4"]
|
||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "rougail.user_data_bitwarden"
|
name = "rougail.user_data_bitwarden"
|
||||||
version = "0.1.0a23"
|
version = "0.1.0a22"
|
||||||
authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}]
|
authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}]
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
description = "Rougail user_data Bitwarden"
|
description = "Rougail user_data Bitwarden"
|
||||||
|
|
@ -25,7 +25,7 @@ classifiers = [
|
||||||
]
|
]
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"rougail >= 1.1,<2",
|
"rougail >= 1.1,<2",
|
||||||
"rougail-structural-bitwarden == 0.1.0a6",
|
"rougail-structural-bitwarden == 0.1.0a5",
|
||||||
]
|
]
|
||||||
|
|
||||||
[project.urls]
|
[project.urls]
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
__version__ = "0.1.0a23"
|
__version__ = "0.1.0a22"
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"errors": [],
|
||||||
|
"warnings": []
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"errors": [],
|
||||||
|
"warnings": []
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"rougail.username": "bitwarden_username",
|
||||||
|
"rougail.secret": "bitwarden_password"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"rougail.username": "example_login",
|
||||||
|
"rougail.secret": "Ex4mpL3_P4ssw0rD"
|
||||||
|
}
|
||||||
|
|
@ -3,10 +3,8 @@
|
||||||
"rougail.project": "5_secret_calc",
|
"rougail.project": "5_secret_calc",
|
||||||
"rougail.environment": "environment",
|
"rougail.environment": "environment",
|
||||||
"rougail.service": "service",
|
"rougail.service": "service",
|
||||||
"rougail.modified_variable": [
|
"rougail.modified_variable": ["user_1", "user_2"],
|
||||||
"user_1",
|
|
||||||
"user_2"
|
|
||||||
],
|
|
||||||
"rougail.dyn_user_1.secret": "bitwarden_password",
|
"rougail.dyn_user_1.secret": "bitwarden_password",
|
||||||
"rougail.dyn_user_2.secret": "bitwarden_password_2"
|
"rougail.dyn_user_2.secret": "bitwarden_password_2"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
{
|
|
||||||
"errors": [],
|
|
||||||
"warnings": [
|
|
||||||
"variable or family \"rougail.modified_variable\" does not exist, it will be ignored when loading from By Hand"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
{
|
|
||||||
"rougail.modified_variable_single": "user_2",
|
|
||||||
"rougail.secret": "bitwarden_password_2"
|
|
||||||
}
|
|
||||||
3
tests/results/9_unknown_type/makedict/bitwarden.json
Normal file
3
tests/results/9_unknown_type/makedict/bitwarden.json
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"rougail.secret.bitwarden": true
|
||||||
|
}
|
||||||
23
tests/structures/2_username_secret_hidden/00-base.yml
Normal file
23
tests/structures/2_username_secret_hidden/00-base.yml
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
---
|
||||||
|
version: 1.1
|
||||||
|
|
||||||
|
username:
|
||||||
|
description: the username
|
||||||
|
type: unix_user
|
||||||
|
secret_manager:
|
||||||
|
host: test
|
||||||
|
project: 2_username_secret_hidden
|
||||||
|
environment: environment
|
||||||
|
service: service
|
||||||
|
user: user
|
||||||
|
|
||||||
|
secret:
|
||||||
|
description: the secret
|
||||||
|
type: secret
|
||||||
|
hidden: true
|
||||||
|
secret_manager:
|
||||||
|
host: test
|
||||||
|
project: 2_username_secret_hidden
|
||||||
|
environment: environment
|
||||||
|
service: service
|
||||||
|
user: user
|
||||||
|
|
@ -1,41 +0,0 @@
|
||||||
%YAML 1.2
|
|
||||||
---
|
|
||||||
version: 1.1
|
|
||||||
|
|
||||||
host:
|
|
||||||
description: hostname
|
|
||||||
default: test
|
|
||||||
hidden: true
|
|
||||||
|
|
||||||
project:
|
|
||||||
description: the project
|
|
||||||
default: 5_secret_calc
|
|
||||||
hidden: true
|
|
||||||
|
|
||||||
environment:
|
|
||||||
description: the environment
|
|
||||||
default: environment
|
|
||||||
hidden: true
|
|
||||||
|
|
||||||
service:
|
|
||||||
description: the service
|
|
||||||
default: service
|
|
||||||
hidden: true
|
|
||||||
|
|
||||||
modified_variable_single: # a variable modified
|
|
||||||
|
|
||||||
secret:
|
|
||||||
description: the second secret
|
|
||||||
type: secret
|
|
||||||
secret_manager:
|
|
||||||
host:
|
|
||||||
variable: _.host
|
|
||||||
project:
|
|
||||||
variable: _.project
|
|
||||||
environment:
|
|
||||||
variable: _.environment
|
|
||||||
service:
|
|
||||||
variable: _.service
|
|
||||||
user:
|
|
||||||
variable: _.modified_variable_single
|
|
||||||
...
|
|
||||||
|
|
@ -24,14 +24,13 @@ def _test_structural_files(test_dir, command, *, env=False, modified=False):
|
||||||
rougailconfig['bitwarden.command'] = command
|
rougailconfig['bitwarden.command'] = command
|
||||||
rougail = Rougail(rougailconfig)
|
rougail = Rougail(rougailconfig)
|
||||||
config = rougail.run()
|
config = rougail.run()
|
||||||
config.property.read_write()
|
|
||||||
# loads variables in the tiramisu config
|
# loads variables in the tiramisu config
|
||||||
generated_user_data = RougailUserData(config, rougailconfig=rougailconfig).run()
|
generated_user_data = RougailUserData(config, rougailconfig=rougailconfig).run()
|
||||||
if modified:
|
if modified:
|
||||||
generated_user_data.insert(0, {'source': 'By Hand', 'errors': [], 'warnings': [], 'values': {'rougail.modified_variable': ['user_1', 'user_2'], 'rougail.modified_variable_single': 'user_2'}})
|
generated_user_data.insert(0, {'source': 'By Hand', 'errors': [], 'warnings': [], 'values': {'rougail.modified_variable': ['user_1', 'user_2'], 'rougail.modified_variable_single': 'user_2'}})
|
||||||
errors = rougail.user_datas(generated_user_data)
|
errors = rougail.user_datas(generated_user_data)
|
||||||
#expected output
|
#expected output
|
||||||
config_dict = dict(config_to_dict(config.value.get()))
|
config_dict = dict(config_to_dict(config.forcepermissive.value.get()))
|
||||||
if not env:
|
if not env:
|
||||||
base_filename = 'bitwarden.json'
|
base_filename = 'bitwarden.json'
|
||||||
else:
|
else:
|
||||||
|
|
@ -109,6 +108,16 @@ def test_structural_files_2_username_secret_invalid_bw():
|
||||||
_test_structural_files(test_dir / '2_username_secret_invalid', 'bw')
|
_test_structural_files(test_dir / '2_username_secret_invalid', 'bw')
|
||||||
|
|
||||||
|
|
||||||
|
def test_structural_files_2_username_secret_hidden_rbw():
|
||||||
|
"tests the output"
|
||||||
|
_test_structural_files(test_dir / '2_username_secret_hidden', 'rbw')
|
||||||
|
|
||||||
|
|
||||||
|
def test_structural_files_2_username_secret_hidden_bw():
|
||||||
|
"tests the output"
|
||||||
|
_test_structural_files(test_dir / '2_username_secret_hidden', 'bw')
|
||||||
|
|
||||||
|
|
||||||
def test_structural_files_3_leadership_secret_rbw():
|
def test_structural_files_3_leadership_secret_rbw():
|
||||||
"tests the output"
|
"tests the output"
|
||||||
_test_structural_files(test_dir / '3_leadership_secret', 'rbw')
|
_test_structural_files(test_dir / '3_leadership_secret', 'rbw')
|
||||||
|
|
@ -169,11 +178,6 @@ def test_structural_files_5_secret_calc_other_user_data2_rbw():
|
||||||
_test_structural_files(test_dir / '5_secret_calc_other_user_data2', 'rbw', modified=True)
|
_test_structural_files(test_dir / '5_secret_calc_other_user_data2', 'rbw', modified=True)
|
||||||
|
|
||||||
|
|
||||||
def test_structural_files_5_secret_calc_other_user_data3_rbw():
|
|
||||||
"tests the output"
|
|
||||||
_test_structural_files(test_dir / '5_secret_calc_other_user_data3', 'rbw', modified=True)
|
|
||||||
|
|
||||||
|
|
||||||
def test_structural_files_6_no_username_rbw():
|
def test_structural_files_6_no_username_rbw():
|
||||||
"tests the output"
|
"tests the output"
|
||||||
_test_structural_files(test_dir / '6_no_username', 'rbw')
|
_test_structural_files(test_dir / '6_no_username', 'rbw')
|
||||||
|
|
@ -272,6 +276,18 @@ def test_structural_files_env_2_username_secret_invalid_bw():
|
||||||
_test_structural_files(test_dir / '2_username_secret_invalid', 'bw', env=True)
|
_test_structural_files(test_dir / '2_username_secret_invalid', 'bw', env=True)
|
||||||
|
|
||||||
|
|
||||||
|
def test_structural_files_env_2_username_secret_hidden_rbw():
|
||||||
|
"tests the output"
|
||||||
|
with mock.patch.dict(os.environ, {'ROUGAIL_BITWARDEN_MOCK_ENABLE': '1'}):
|
||||||
|
_test_structural_files(test_dir / '2_username_secret_hidden', 'rbw', env=True)
|
||||||
|
|
||||||
|
|
||||||
|
def test_structural_files_env_2_username_secret_hidden_bw():
|
||||||
|
"tests the output"
|
||||||
|
with mock.patch.dict(os.environ, {'ROUGAIL_BITWARDEN_MOCK_ENABLE': '1'}):
|
||||||
|
_test_structural_files(test_dir / '2_username_secret_hidden', 'bw', env=True)
|
||||||
|
|
||||||
|
|
||||||
def test_structural_files_env_3_leadership_secret_rbw():
|
def test_structural_files_env_3_leadership_secret_rbw():
|
||||||
"tests the output"
|
"tests the output"
|
||||||
with mock.patch.dict(os.environ, {'ROUGAIL_BITWARDEN_MOCK_ENABLE': '1'}):
|
with mock.patch.dict(os.environ, {'ROUGAIL_BITWARDEN_MOCK_ENABLE': '1'}):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue