Giter Site home page Giter Site logo

googapis's People

Contributors

codahale avatar mechiru avatar nathanhowell avatar plaflamme avatar renovate-bot avatar shikhar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

googapis's Issues

Getting 404 from compute

I'm not certain if this is a bug in the lib or if I'm doing something wrong but I feel like I followed the example pretty closely.

#![allow(unused_imports)]

use googapis::{
	CERTIFICATES,
	google::cloud::compute::v1::{
		Instance,
		ForwardingRule,
		GetInstanceRequest,
		ListInstancesRequest,
        AggregatedListInstancesRequest,
        instances_client::InstancesClient,
        InstanceAggregatedList,
		projects_client::ProjectsClient,
		GetProjectRequest
	},
};
use gouth::Token;
use tonic::{
    metadata::MetadataValue,
    transport::{Certificate, Channel, ClientTlsConfig},
    Request,
};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error + 'static>> {
    let token = Token::new()?;

	let tls_config = ClientTlsConfig::new()
		.ca_certificate(Certificate::from_pem(CERTIFICATES))
		.domain_name("compute.googleapis.com");

	let channel = Channel::from_static("https://compute.googleapis.com")
        .tls_config(tls_config)?
        .connect()
        .await?;

    let mut service = ProjectsClient::with_interceptor(channel, move |mut req: Request<()>| {
        let token = &*token.header_value().unwrap();
        let meta = MetadataValue::from_str(token).unwrap();
        req.metadata_mut().insert("authorization", meta);
        Ok(req)
    });

    let instances = service.get(Request::new(GetProjectRequest {
        project: "<project >".into(),
        ..Default::default()
    }))
    .await?;

    println!("{:#?}", instances);

    Ok(())
}

and the response looks like

Error: Status { code: Internal, message: "protocol error: received message with invalid compression flag: 60 (valid flags are 0 and 1) while receiving response with status: 404 Not Found", metadata: MetadataMap { headers: {"content-type": "text/html; charset=UTF-8", "referrer-policy": "no-referrer", "content-length": "1597", "date": "Sun, 28 Nov 2021 16:14:35 GMT", "alt-svc": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\""} }, source: None }

I'm using 0.6

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

cargo
googapis/Cargo.toml
  • tonic 0.6.1
  • prost 0.9.0
  • prost-types 0.9.0
xtask/Cargo.toml
  • tonic-build 0.6
  • prost-build 0.9
git-submodules
.gitmodules
  • xtask/proto/googleapis master@02df998e40733c077aa0fc3f35a6b2d48aa8bf84
github-actions
.github/workflows/ci.yml
  • actions/checkout v2
  • actions-rs/toolchain v1
.github/workflows/doc.yml
  • actions/checkout v2
  • actions-rs/toolchain v1
  • peaceiris/actions-gh-pages v3

  • Check this box to trigger a request for Renovate to run again on this repository

Remove CERTIFICATES

As of hyperium/tonic#660, it is convenient to simply enable the tonic tls-webpki-roots crate feature.

With that feature enabled, one can omit tls_config() on the Channel and everything JustWorks:tm:

Automatically publish

I'm planning to do an automated test triggered by an update of the renovate bot's git submodule, merge it if it works, and publish it to crates.io.
I did it manually for the first few months, but when I'm busy it gets harder to update. So I think we need to prioritize this task.

The following needs to be resolved :

  • generate code
    • Even if the code generation is successful, the build may fail.
  • automatically update features
    • Only those that build successfully will be accepted as features. I'm doing it manually now, but it's very painful.
  • versioning rule
    • Currently, when I generate the code, I am raising the patch version. However, due to the update of the proto file, it may not follow the rules of the semantic version.

Cannot install 0.3.x from crates.io

There are multiple versions of 0.3.0 and 0.3.1... cargo downloads one version and validates against the other one. this is a long standing bug, but basically you just need to bump the version number every publish.

> cargo build
  Downloaded googapis v0.3.1+20200930
error: failed to verify the checksum of `googapis v0.3.1+20200930`

see for more info rust-lang/crates.io#1059

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.