Skip to content
This repository was archived by the owner on Nov 13, 2025. It is now read-only.

iroco-co/hyper-auth-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The site has moved here.


As an organization that values the building of digital commons, we do not want to participate to the OpenAI/Microsoft LLM model development.

  1. We believe that this model is harmful to human cognition, data privacy, the environment (Copilot consumes 20.8W of power with 90% loss), misinformation, and all its biases: colonialism, racism, sexism. We are not against AI, we are against the way AI is implemented with Copilot by GitHub and ultimately Microsoft and OpenAI. We use it (for example for translations) sparingly and conscientiously.

  2. We do not want to contribute to the techno-authoritarian stack that is developing in the United States. We disapprove of Microsoft's involvement in the hydrocarbon extraction companies. We don't understand the version management policy for Windows 10. Last but not least, we wish to maintain sovereignty over our IT stack.

Long version is here.


Version Française

En tant qu'organisation qui valorise la construction de communs numériques, nous ne souhaitons pas alimenter les modèles LLM OpenAI/Microsoft.

  1. Nous pensons l'IA générative est délétère, pour la cognition humaine, le respect des données, l'environnement (l'utilisation de copilot représente une puissance de 20,8W avec 90% de perte), la désinformation, et tous ses biais : le colonialisme, le racisme, le sexisme. Nous ne sommes pas contre l'IA en tant que telle, nous sommes contre la manière dont l'IA est mise en oeuvre avec Copilot par GitHub et finalement Microsoft et OpenAI.

  2. Nous ne voulons pas alimenter l'écosystème techno-autoritaire qui se met en place aux Etats-Unis. Nous réprouvons l'aide aux sociétés extractives d'hydrocarbures. Nous ne comprenons pas la politique de gestion de version de Windows 10. Surtout, nous souhaitons conserver la souveraineté sur notre environnement informatique.

La version longue est ici.

hyper-auth-proxy CircleCI


A proxy to do http basic auth from a JWT token and redis session credentials

schema

usage

Little auth proxy based on hyper-reverse-proxy that can be used to add Basic auth header for a backend service without having to send credentials base64 encoded on the web.

It will use JWK token key sid field to seek for the credentials in a Redis instance. The JWT token is read from Authorization cookie. The credentials are stored in json :

{ "credentials": "dXNlcjp0ZXN0" }

They can be used "as is" or the credentials can be encoded (for example with AES).

Without encoded credentials, the proxy will make a request with Authorization header :

Authorization: Basic dXNlcjp0ZXN0

The main should contain a tokio main section and call the run_service function.

Example :

use hyper_auth_proxy::{run_service, ProxyConfig};

#[tokio::main]
async fn main() {
    let (_tx, rx) = tokio::sync::oneshot::channel::<()>();
    let config = ProxyConfig::default();
    let server = run_service(config.clone(), rx).await;
    println!("Running auth proxy on {:?} with backend {:?}", config.address, config.back_uri);
    if let Err(e) = server.await {
        eprintln!("server error: {}", e);
    }
}

The proxy configuration contains the following parameters :

 use std::net::SocketAddr;
 struct ProxyConfig {
    pub jwt_key: String,
    pub credentials_key: String,
    pub back_uri: String,
    pub redis_uri: String,
    pub address: SocketAddr,
}

logging && debugging

It uses log API so for example with env_logger it can be launched with

$ RUST_LOG=debug hyper-auth-proxy

And you should have logs like :

[2022-03-16T12:51:26Z INFO  my_auth_proxy] Running auth proxy on 127.0.0.1:3000 with backend "http://backend"
[2022-03-16T12:51:33Z DEBUG hyper_auth_proxy] cannot find auth cookie: no cookies header
[2022-03-16T12:53:21Z DEBUG hyper_auth_proxy] cannot find auth cookie: no auth cookie
[2022-03-16T12:53:35Z DEBUG hyper_auth_proxy] cannot decode jwt token: cannot decode jwt token (No claims component found in token string)

About

Proxy to do http basic auth from a JWT token and redis session credentials

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages