Comments (5)
@adnanjpg thank you pointing this out. Let me test the scenarios you mentioned and hopefully we can find a good solution. So far I've been using the the serv_account module in this project with tokio runtime https://github.com/makarski/mstream/blob/main/src/cmd/listener.rs#L24-L25. However, the dependency there is gauth = 0.4
that is using a version of reqwest before async was introduced.
Before the issue is fixed, a version 0.4 will do, as the changes introduced in 0.5 affect the desktop app auth - there i also updated the reqwest client that introduced the issue.
from gauth-rs.
Also always looking forward to have a PR opened
from gauth-rs.
as suggested in this stackoverflow answer, running the from_file
function on a seperate thread fixes the issue
use std::thread;
#[tokio::main]
async fn main() {
thread::spawn(|| {
gauth::serv_account::ServiceAccount::from_file(
"service-account-key.json",
vec!["https://www.googleapis.com/auth/firebase.messaging"],
);
})
.join()
.expect("Thread panicked")
}
from gauth-rs.
after investigation, the actual reason for this error is the usage reqwest::blocking::Client
, as that apparently interferes with the threads that tokio is supposed to manage.
converting all necessary to async actually fixes the problem.
however, using async functions breaks the tests, as per my research it appaears that an external async test library is required.
if you're interested, I can open a pr with the current work
from gauth-rs.
sure, here's the pr #26
from gauth-rs.
Related Issues (13)
- Add tests in lib.rs
- Add tests in `credentials.rs`
- Update README
- Document the code
- Add an option to request additional scopes
- Add an option to revoke the token
- Fix concurrent test run
- Add web-server application support
- Add LICENCE HOT 1
- Check sub-licensing
- No `Other` application type when creating OAuth client ID HOT 2
- Support for creating ServiceAccount from string instead of file path HOT 8
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 gauth-rs.