Skip to content

Cannot push to main branch, when branch feature is activated #413

@s53kr-lm8a6r

Description

@s53kr-lm8a6r

Expected

should be able to push to main branch when branch feature is active

Actual

when and only when branch feature is active using structurizr/onpremises, pushing to main branch results in error
however, pushes to any other branches completed successfully

error is attached below

com.structurizr.api.StructurizrClientException: Authorization header doesn't match
com.structurizr.api.StructurizrClientException: com.structurizr.api.StructurizrClientException: Authorization header doesn't match
        at com.structurizr.api.WorkspaceApiClient.putWorkspace(WorkspaceApiClient.java:351)
        at com.structurizr.cli.PushCommand.run(PushCommand.java:147)
        at com.structurizr.cli.StructurizrCliApplication.run(StructurizrCliApplication.java:83)
        at com.structurizr.cli.StructurizrCliApplication.main(StructurizrCliApplication.java:104)
Caused by: com.structurizr.api.StructurizrClientException: Authorization header doesn't match
        at com.structurizr.api.WorkspaceApiClient.putWorkspace(WorkspaceApiClient.java:346)
        ... 3 more

Steps to reproduce

tested on structurizr/onpremises using structurizr-cli (all latest)
push to main branch, whether using --branch parameter, or leave it default

Version/build information

latest

Severity

Critical

Priority

Low (I'm willing to make a pull request - please confirm approach first)

More information

i've debugged structurizr/onpremises and structurizr-cli, there is a bug on hmac validation, caused by path condition when "main" branch is selected
at some point, when we push to "main" branch, the client hashes path using "/api/workspace/{id}/branch/{id}"
but the internal validation in structurizr/onpremises is using "/api/workspace/{id}"

i post this issue in this repo, since the fix is highly probably to be implemented in this repo instead of the structurizr/onpremises

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions