Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Header authentication not sent for appComponent dependencies #162

Open
Charrey opened this issue Dec 23, 2022 · 0 comments
Open

Header authentication not sent for appComponent dependencies #162

Charrey opened this issue Dec 23, 2022 · 0 comments

Comments

@Charrey
Copy link

Charrey commented Dec 23, 2022

Environment

  • Platform version: 7.2.20
  • Gradle version: 5.6.4

Description of the bug or enhancement

When fetching appComponents from a Maven repository that uses HTTP header authentication (such as Gitlab) the header and header value specified in the CUBA project's build.gradle are ignored.

Minimal reproducible example

Take the following cuba project:
minimalexample.zip

Open a request bin on localhost port 1234 or change the secondary repository to a remote requestbin. Then sync the gradle project / run gradle build.

Expected behavior

A header is included with the name authorization-header and value very-secret-authorization-token

Actual behavior

No such header is included

Fix

In CubaPlugin.groovy replace the following code:

172 maven {
173     url mavenRepo.url
174     credentials(HttpHeaderCredentials) {
175         name(httpHeaderCredentials.name ?: '')
176         value(httpHeaderCredentials.value ?: '')
177     }
178 }

by this code:

maven {
    url mavenRepo.url
    credentials(HttpHeaderCredentials) {
         name(httpHeaderCredentials.name ?: '')
         value(httpHeaderCredentials.value ?: '')
     }
     authentication {
         header(HttpHeaderAuthentication)
     }
 }
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

No branches or pull requests

1 participant