return Url as string

To make perl bindings simple.
This commit is contained in:
Dietmar Maurer 2021-06-21 14:12:13 +02:00
parent cc64c7e35d
commit ac034c72da
2 changed files with 6 additions and 7 deletions

8
debian/control vendored
View File

@ -45,10 +45,10 @@ Provides:
librust-proxmox-openid+default-dev (= ${binary:Version}),
librust-proxmox-openid-0-dev (= ${binary:Version}),
librust-proxmox-openid-0+default-dev (= ${binary:Version}),
librust-proxmox-openid-0.1-dev (= ${binary:Version}),
librust-proxmox-openid-0.1+default-dev (= ${binary:Version}),
librust-proxmox-openid-0.1.0-dev (= ${binary:Version}),
librust-proxmox-openid-0.1.0+default-dev (= ${binary:Version})
librust-proxmox-openid-0.2-dev (= ${binary:Version}),
librust-proxmox-openid-0.2+default-dev (= ${binary:Version}),
librust-proxmox-openid-0.2.0-dev (= ${binary:Version}),
librust-proxmox-openid-0.2.0+default-dev (= ${binary:Version})
Description: Rust crate "proxmox-openid" - Rust source code
This package contains the source for the Rust proxmox-openid crate, packaged by
debcargo for use with cargo and dh-cargo.

View File

@ -2,7 +2,6 @@ use std::path::Path;
use anyhow::{format_err, Error};
use serde::{Deserialize, Serialize};
use url::Url;
mod http_client;
pub use http_client::http_client;
@ -115,7 +114,7 @@ impl OpenIdAuthenticator {
})
}
pub fn authorize_url(&self, state_dir: &str, realm: &str) -> Result<Url, Error> {
pub fn authorize_url(&self, state_dir: &str, realm: &str) -> Result<String, Error> {
let private_auth_state = PrivateAuthState::new();
let public_auth_state = private_auth_state.public_state_string(realm.to_string())?;
@ -137,7 +136,7 @@ impl OpenIdAuthenticator {
.set_pkce_challenge(private_auth_state.pkce_challenge())
.url();
Ok(authorize_url.into())
Ok(authorize_url.to_string())
}
pub fn verify_public_auth_state(