Skip to content

Adds hash per directory entry#2538

Open
Tschuppi81 wants to merge 1 commit into
masterfrom
feature/ogc-3096-directories-hash-for-each-entry
Open

Adds hash per directory entry#2538
Tschuppi81 wants to merge 1 commit into
masterfrom
feature/ogc-3096-directories-hash-for-each-entry

Conversation

@Tschuppi81

Copy link
Copy Markdown
Contributor

Directory: Adds has per directory entry

Each directory entry holds a SHA-256 hash of all field values and associated file checksums. The hash is recalculated on every change/update. Also the hash is visible on the api

TYPE: Feature
LINK: ogc-3096

@linear

linear Bot commented Jun 19, 2026

Copy link
Copy Markdown

OGC-3096

@codecov

codecov Bot commented Jun 19, 2026

Copy link
Copy Markdown

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
2434 1 2433 11
View the top 1 failed test(s) by shortest run time
tests/onegov/core/test_cronjobs.py::test_disable_cronjobs
Stack Traces | 0.837s run time
redis_url = 'redis://127.0.0.1:20118/0'

    def test_disable_cronjobs(redis_url: str) -> None:
    
        class App(Framework):
            pass
    
        @App.path(path='')
        class Root:
            pass
    
        @App.json(model=Root)
        def view_root(self: Root, request: CoreRequest) -> JSON_ro:
            return {}
    
        @App.cronjob(hour=8, minute=0, timezone='UTC')
        def run_test_cronjob(request: CoreRequest) -> None:
            pass
    
        @App.setting(section='cronjobs', name='enabled')
        def cronjobs_enabled() -> bool:
            return False
    
        scan_morepath_modules(App)
    
        app = App()
        app.namespace = 'municipalities'
>       app.configure_application(redis_url=redis_url)

.../onegov/core/test_cronjobs.py:106: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.../onegov/core/framework.py:444: in configure_application
    method(self, **cfg)
.../onegov/core/framework.py:497: in configure_secrets
    or stored_random_token(self.__class__.__name__, 'identity_secret'))
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

namespace = 'App', name = 'identity_secret'

    def stored_random_token(namespace: str, name: str) -> str:
        """ A random token that is only created once per boot of the host
        (assuming the host deletes all files in the /tmp folder).
    
        This method should only be used for development and is not meant for
        general use!
    
        """
        # NOTE: Since this is only used for development:
        #       The hardcoded path is a feature, not a bug
        namespace_dir = os.path.join('/tmp/onegov-secrets', namespace)  # nosec:B108
        os.makedirs(namespace_dir, mode=0o700, exist_ok=True)
    
        path = os.path.join(namespace_dir, name)
        if os.path.isfile(path):
            with open(path) as f:
                return f.read()
    
        token = random_token()
    
>       with open(path, mode='w') as f:
             ^^^^^^^^^^^^^^^^^^^^
E       PermissionError: [Errno 13] Permission denied: '.../onegov-secrets/App/identity_secret'

.../core/crypto/token.py:65: PermissionError

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant