Compare commits

...

14 commits

10 changed files with 290 additions and 0 deletions

41
CHANGELOG.md Normal file
View file

@ -0,0 +1,41 @@
## 0.1.0a6 (2025-10-16)
### Fix
- do not remove force_default_on_freeze
## 0.1.0a5 (2025-06-18)
### Fix
- rougail separation
## 0.1.0a4 (2025-04-09)
### Fix
- version
## 0.1.0a3 (2025-03-19)
### Feat
- port to rougail secret_manager
## 0.1.0a2 (2025-02-17)
### Fix
- support hidden attribut
## 0.1.0a1 (2025-02-17)
### Fix
- annotator is in structural plugin
## 0.1.0a0 (2025-02-13)
### Feat
- first version

View file

@ -0,0 +1,56 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR ORGANIZATION
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: 2025-03-11 12:46+0100\n"
"PO-Revision-Date: 2025-03-11 12:52+0100\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: pygettext.py 1.5\n"
"X-Generator: Poedit 3.5\n"
#: src/rougail/structural_bitwarden/annotator.py:47
msgid ""
"only \"unix_user\" or \"secret\" variable type can have \"bitwarden\" "
"attribute, but \"{0}\" has type \"{1}\""
msgstr ""
"seulement une variable du type \"unix_user\" ou \"secret\" peut avoir un "
"attribut \"bitwarden\", mais \"{0}\" a le type \"{1}\""
#: src/rougail/structural_bitwarden/annotator.py:50
msgid ""
"the variable \"{0}\" has attribute \"bitwarden\" but is a multi variable"
msgstr ""
"la variable \"{0}\" a l'attribut \"bitwarden\" mais est une variable "
"multiple"
#: src/rougail/structural_bitwarden/annotator.py:59
msgid ""
"the variable \"{0}\" is a follower and leader variable (\"{1}\") is also in "
"Bitwarden so this variable could not have default value"
msgstr ""
"la variable \"{0}\" est une variable suiveuse et la variable meneuse "
"(\"{1}\") est aussi dans Bitwarden donc cette variable ne peut avoir avoir "
"de valeur par défaut"
#: src/rougail/structural_bitwarden/annotator.py:63
msgid "the variable \"{0}\" is in Bitwarden so should have default value"
msgstr ""
"la variable \"{0}\" est dans Bitwarden donc cette variable devrait avoir un "
"valeur par défaut"
#: src/rougail/structural_bitwarden/config.py:31
msgid "The secret pattern to build item name in Bitwarden"
msgstr ""
"Le patron du secret pour construire le nom de l'élément dans Bitwarden"
#: src/rougail/structural_bitwarden/config.py:32
msgid "The pattern is in Jinja format"
msgstr "Le patron est au format Jinja"

View file

@ -0,0 +1,17 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR ORGANIZATION
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2025-05-12 08:39+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: pygettext.py 1.5\n"

44
pyproject.toml Normal file
View file

@ -0,0 +1,44 @@
[build-system]
build-backend = "flit_core.buildapi"
requires = ["flit_core >=3.8.0,<4"]
[project]
name = "rougail.structural_bitwarden"
version = "0.1.0a6"
authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}]
readme = "README.md"
description = "Rougail structural Bitwarden"
requires-python = ">=3.8"
license = {file = "LICENSE"}
classifiers = [
"License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)",
"Programming Language :: Python",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: 3",
"Operating System :: OS Independent",
"Natural Language :: English",
"Natural Language :: French",
]
dependencies = [
"rougail >= 1.1,<2",
"rougail-user-data-bitwarden >= 0.0,<2",
]
[project.urls]
Home = "https://forge.cloud.silique.fr/stove/rougail-structural-bitwarden"
[tool.commitizen]
name = "cz_conventional_commits"
tag_format = "$version"
version_scheme = "pep440"
version_provider = "pep621"
version_files = [
"src/rougail/structural_bitwarden/__version__.py",
"pyproject.toml:version"
]
update_changelog_on_bump = true
changelog_merge_prerelease = true

View file

@ -0,0 +1,23 @@
"""
Silique (https://www.silique.fr)
Copyright (C) 2025
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by the
Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
from .__version__ import __version__
__all__ = tuple()

View file

@ -0,0 +1 @@
__version__ = "0.1.0a6"

View file

@ -0,0 +1,50 @@
"""
Silique (https://www.silique.fr)
Copyright (C) 2025
distribued with GPL-2 or later license
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
"""
from rougail.error import DictConsistencyError
from rougail.annotator.variable import Walk
from rougail.convert.object_model import JinjaCalculation
from .i18n import _
class Annotator(Walk):
"""Annotate for bitwarden"""
level = 90
def __init__(
self,
objectspace,
*args, # pylint: disable=unused-argument
) -> None:
if not objectspace.paths:
return
self.objectspace = objectspace
self.check_variable()
def check_variable(self):
for variable in self.get_variables():
if not variable.secret_manager:
continue
path = variable.path
self.objectspace.informations.add(path, "bitwarden", True)
self.objectspace.informations.add(path, "default_value_makes_sense", False)
self.objectspace.properties.add(path, "novalidator", True)
variable.default = variable.secret_manager

View file

@ -0,0 +1,32 @@
"""
Silique (https://www.silique.fr)
Copyright (C) 2025
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by the
Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
def get_rougail_config(
*,
backward_compatibility: bool = True, # pylint: disable=unused-argument
) -> dict:
return {
"name": "bitwarden",
"process": "structural",
"level": 90,
}
__all__ = ("get_rougail_config",)

View file

@ -0,0 +1,26 @@
"""
Silique (https://www.silique.fr)
Copyright (C) 2025
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by the
Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
from gettext import translation
from pathlib import Path
t = translation(
"rougail_structural_bitwarden", str(Path(__file__).parent / "locale"), fallback=True
)
_ = t.gettext