Comments (8)
Oh, indeed, I can see which
was still there in 0.12.0
. I can confirm it fails to find the gcloud
command on 0.12.0
though. I'll keep looking into why it fails to find it.
from gcp_auth.
Sounds great, can you submit a PR?
from gcp_auth.
Do you want to try to revert #109 and see if that works for you? (I think if the removal of which is the cause, 0.12.0 should work for you since IIRC I only removed that in in 0.12.1.)
from gcp_auth.
Right, I wasn't pinning 0.12.0
correctly on my application's Cargo.toml
. Once I pinned it correctly, the application worked. I confirmed this by checking out the 0.12.0
tag and running the simple
example, then checking 0.12.1
and running the example. It succeeds on 0.12.0
and fails on 0.12.1
. Re-adding the which
code to 0.12.1
gets it working again. Happy to create a PR reverting the change, but wanted to check if there was another reason for removing the which
dependency in the first place and other solution might be appropriate.
from gcp_auth.
I'm wondering, if you open a Command Prompt on Windows, can you successfully invoke Windows? I should probably also look at how which is implemented on Windows.
from gcp_auth.
I'm generally open to the idea of reverting the change that removed which but would like to understand why it's needed here. Maybe it could be a Windows-only dependency?
from gcp_auth.
It does work on the command line.
It turns out the problem is not the path, but the executable name. The actual executable name on Windows is gcloud.cmd
. While, on the Command Prompt simply calling gcloud
works and gcloud.cmd
is invoked, that doesn't seems to be the case when spawning a process with Rust's Command
.
So, this makes it work:
let mut command = Command::new("gcloud.cmd");
I think just moving the command name to OS specific variable should work:
fn run(cmd: &[&str]) -> Result<String, Error> {
let mut command = Command::new(GCLOUD_CMD);
command.args(cmd);
...
}
...
#[cfg(any(target_os = "linux", target_os = "macos"))]
const GCLOUD_CMD: &str = "gcloud";
#[cfg(target_os = "windows")]
const GCLOUD_CMD: &str = "gcloud.cmd";
from gcp_auth.
Created #113. Tested on Windows and MacOS.
from gcp_auth.
Related Issues (19)
- No tests but "Master's student" what a joke
- License contains references to yup-oauth2 HOT 2
- Credentials loading order? HOT 2
- Examples for using AuthenticationManager from many threads? HOT 13
- get_token never finishes HOT 3
- gcloud stores application user credentials in an SQLLite database HOT 4
- gcp_auth::init() requires GOOGLE_APPLICATION_CREDENTIALS be defined HOT 3
- Make it possible to parse secrets from string or bytes rather than providing path to file HOT 4
- Using `#[tracing::instrument]` on `refresh_token()` leaks sensitive information to logs HOT 2
- Using GOOGLE_APPLICATION_CREDENTIALS to specify an authorized_user or impersonated_service_account JSON key file giving "missing field `private_key`" error HOT 22
- My token looks like a morse code HOT 4
- Tokens fetched via a GCloudAuthorizedUser do not refresh HOT 4
- Possible to release new gcp_auth? HOT 2
- background token refresh HOT 2
- Support audience HOT 2
- Adjust logging level for `tracing` crate HOT 2
- Unable to load `application_default_credentials.json` on Windows HOT 7
- Allow overriding the project id for a given TokenProvider HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gcp_auth.