infrastructure capa

infrastructure-google-auth

Google service-account auth — RS256 JWT to OAuth2 access token (server-to-server flow)

Google service-account auth — RS256 JWT to OAuth2 access token (server-to-server flow)

Tierinfrastructure
Roleunclassified (baselined)
Pathcrates/infrastructure/google-auth
Edition2021
Targetsinfrastructure_google_auth, google_auth
Public items0 across 0 modules
Tests18

What it is for

Google API authentication — two headless server-side flows.

exchanged at the token endpoint for an access token (the two-legged / JWT-bearer flow).

refresh token, obtained once via an interactive consent, exchanged for access tokens. For reaching an API as a consenting user.

No PKCE and no browser redirect at runtime. Reusable by any Google-API client library crate.

# Example

use infrastructure_google_auth::{Client, ServiceAccountKey};

let key = ServiceAccountKey::from_file("/path/to/service-account.json")?;
let mut auth = Client::new(
key,
&"https://www.googleapis.com/auth/webmasters.readonly",
);
let bearer = auth.token().await?;
# Ok::<(), infrastructure_google_auth::GoogleAuthError>(())

Capabilities

No public items.

How to use it

From this crate's own rustdoc:

use infrastructure_google_auth::{Client, ServiceAccountKey};

let key = ServiceAccountKey::from_file("/path/to/service-account.json")?;
let mut auth = Client::new(
    key,
    &["https://www.googleapis.com/auth/webmasters.readonly"],
);
let bearer = auth.token().await?;
# Ok::<(), infrastructure_google_auth::GoogleAuthError>(())

Module structure

No public modules: the crate root is its whole surface.

Public surface

No public items.

Re-exports. Exported here, defined elsewhere.

ExportDefined in
Clientclient::Client
GoogleAuthErrorerror::GoogleAuthError
ServiceAccountKeykey::ServiceAccountKey
{build_assertion,fetch_token,AccessToken}token::{build_assertion,fetch_token,AccessToken}
{fetch_oauth_token,OAuthCredentials}oauth::{fetch_oauth_token,OAuthCredentials}

Boundary

Depends on no other workspace tier.

Shares tier infrastructure with 82 other crates: infrastructure-acquire, infrastructure-adapters-google-calendar, infrastructure-adapters-google-gmail, infrastructure-adapters-google-places, infrastructure-adapters-google-trends, infrastructure-adapters-shodan, infrastructure-adapters-yelp, infrastructure-agent, … (82 total).

_What this crate deliberately does NOT own is a judgment. No committed registry records one for it, so none is stated here._

Where it sits

Tier (ontology)infrastructure
Architectural role (taxonomy)unclassified (baselined)
Locationcrates/infrastructure/google-auth
Vocabulary in force (lexicon)current

Dependencies

Runtime, in this workspace.

CrateTierOptionalOnly on
`infrastructure-fetcher`infrastructurenoalways

Runtime, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
chrono^0.4serdenoalways
jsonwebtoken^9noalways
reqwest^0.12json, rustls-tlsnoalways
serde^1derivenoalways
serde_json^1noalways
thiserror^2noalways
tracing^0.1noalways

Development, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
tokio^1fullnoalways
wiremock^0.6noalways

Build. None.

Depended on by. 2 workspace crates.

Signal flow — what reaches this crate, and what it reaches.

flowchart LR
  n_application_google_auth["application-google-auth"] -->|uses| SELF
  n_infrastructure_search_console["infrastructure-search-console"] -->|uses| SELF
  SELF["infrastructure-google-auth"]
  SELF -->|runtime| n_infrastructure_fetcher["infrastructure-fetcher"]
  classDef self fill:#1f883d,stroke:#1f883d,color:#fff;
  class SELF self;

Feature flags

No Cargo features are defined: every capability is unconditional, so no consumer can receive a half-wired crate.

Targets

KindNameSource
libinfrastructure_google_auth`src/lib.rs`
testgoogle_auth`tests/google_auth.rs`

Error model

No public error type was detected: no public item declares a type named *Error, and no public signature returns one.

Operational characteristics

PropertyEvidence
async public surfacenone detected
async runtimenone detected
database accessnone detected
network I/Oyes
unsafe codenone detected
environment variablesnone detected

No unsafe block, unsafe fn, unsafe impl or unsafe trait was found by the parser anywhere in this crate's source.

Configuration

No environment variable is read with a literal name anywhere in this crate. A variable whose key is computed at run time cannot be listed here, and is not claimed to be absent.

2 workspace crates depend on this one: application-google-auth, infrastructure-search-console.

Verification

KindCount
Unit tests5
Integration tests13
Examples0
Doctests1

What the tests establish, by name:

Documentation coverage

MeasureDocumentedTotal
Public items with rustdoc00
Public modules with a //! block00

Metrics

MetricValue
Rust source files6
Source lines767
Code lines449
Public API items0
Public modules0
Tests18
Examples0
Cargo features0
Direct runtime dependencies8
Workspace reverse dependencies2
pie showData
    title Rust source composition
    "Code" : 449
    "Blank or comment" : 318

Generation

Rendered by tools-corpus corpus readme from repository evidence alone, renderer schema 2, lexicon current. No model, network service or database was consulted. Regenerate with tools-corpus corpus readme --write; verify with --check.

Todas las infrastructure · Manual