Replies: 2 comments 2 replies
-
cc @Yannic |
Beta Was this translation helpful? Give feedback.
1 reply
-
None of the repository rules support credential helpers yet. Right now they
can only be used to obtain credentials for remote caching, execution and
the build event service.
…On Thu, Apr 27, 2023 at 10:59 pannagger ***@***.***> wrote:
oh okay, thank you for clarification.
can you quickly help me, which rules are supporting credential_helper at
this time?
—
Reply to this email directly, view it on GitHub
<#18232 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABBK5HPHO4SLQEJA3QZM4H3XDIYPTANCNFSM6AAAAAAXNOUIUI>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
pannagger
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I want to use the credential helper for authorization against artifactory.
I set up a tiny project:
WORKSPACE:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "test_artifactory",
url = "https://my/url/to/artifacts/external-deps.zip",
)
BUILD:
_load("@rules_java//java:defs.bzl", "java_binary")
package(default_visibility = ["//visibility:public"])
java_binary(
name = "ProjectRunner",
srcs = ["src/ProjectRunner.java"],
main_class = "src.ProjectRunner",
deps = ["@test_artifactory//:greeter"],
)
java_library(
name = "greeter",
srcs = ["src/Greeting.java"],
)_
Without the http_archive bazel build command succeeds, including http_archive it fails with expected 401 error, so far so good.
Now I want to use credential helper for authorization, for testing purpose I just implemented a script called creds_helper which prints argv and stdin into a file, to see how bazel calls it:
_#!/bin/bash
arg1=$1
arg2=$2
echo "$arg1" >> output.txt
echo "$arg2" >> output.txt
cat >> output.txt_
Now I build project by calling:
bazel build //:ProjectRunner --experimental_credential_helper=/workspace/creds_helper
What I expect is bazel trying to use creds_helper to get credentials and see in output file how bazel calls my creds_helper..
But anyway, output file is empty, so I assume bazel is not calling creds_helper at all.
How to treat this issue, do I have to add some additional properties to http_archive so bazel uses cred_helper?
Can anyone help on this?
Kind regards,
Philip
Beta Was this translation helpful? Give feedback.
All reactions