Skip to content

GitLab Trusted Publisher case sensitivity #18797

@mrossinek

Description

@mrossinek

Describe the bug
Setting up a trusted publisher for GitLab CI requires case sensitivity that does not match the actual spelling.

I have a project on GitLab where the organization has a captialized letter in it: coBib. The URL is https://gitlab.com/cobib/cobib.
I configured a trusted publisher for the cobib package specifying the owner as coBib and project as cobib.
This resulted in the following error:

ERROR    TrustedPublishingFailure: The token request failed; the index server   
         gave the following reasons:                                            
                                                                                
         * `invalid-publisher`: valid token, but no corresponding publisher     
         (Publisher with matching claims was not found)  

It was only after playing around a bit, that I tried to set owner to cobib, after which my trusted publisher config worked.

Expected behavior
The owner field of a trusted publisher should not be case sensitive.

I thought, that this is already the case, but I still ran into this problem on Wednesday of this week.

To Reproduce

  • Create a project on GitLab with an organization name using a capitalized letter
  • Configure a trusted publisher for .gitlab-ci.yml where the correct capitalized spelling is used
  • Observe the token failure

My Platform

Additional context
There are some (semi-)related issues which all appear to be resolved:

Looking at the GitLab oidc model, I would even expect the current code to work, which further adds to my confusion of why it did not:

return f"{namespace}:{project}".lower() == ground_truth.lower()

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions