Add privacy policy and terms of use
This commit is contained in:
parent
7e6de7fb2c
commit
aa73f363bc
@ -297,6 +297,17 @@ pub async fn main() {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
.nest(
|
||||||
|
"/legal",
|
||||||
|
get_service(ServeDir::new("./static/legal")).handle_error(
|
||||||
|
|error: std::io::Error| async move {
|
||||||
|
(
|
||||||
|
StatusCode::INTERNAL_SERVER_ERROR,
|
||||||
|
format!("Unhandled internal error: {}", error),
|
||||||
|
)
|
||||||
|
},
|
||||||
|
),
|
||||||
|
)
|
||||||
.nest(
|
.nest(
|
||||||
"/img",
|
"/img",
|
||||||
get_service(ServeDir::new("./static/img")).handle_error(
|
get_service(ServeDir::new("./static/img")).handle_error(
|
||||||
|
20
src/oidc.rs
20
src/oidc.rs
@ -18,9 +18,9 @@ use openidconnect::{
|
|||||||
url::Url,
|
url::Url,
|
||||||
AccessToken, Audience, AuthUrl, ClientConfigUrl, ClientId, ClientSecret, EmptyAdditionalClaims,
|
AccessToken, Audience, AuthUrl, ClientConfigUrl, ClientId, ClientSecret, EmptyAdditionalClaims,
|
||||||
EmptyAdditionalProviderMetadata, EmptyExtraTokenFields, EndUserPictureUrl, EndUserUsername,
|
EmptyAdditionalProviderMetadata, EmptyExtraTokenFields, EndUserPictureUrl, EndUserUsername,
|
||||||
IssuerUrl, JsonWebKeyId, JsonWebKeySetUrl, LocalizedClaim, Nonce, PrivateSigningKey,
|
IssuerUrl, JsonWebKeyId, JsonWebKeySetUrl, LocalizedClaim, Nonce, OpPolicyUrl, OpTosUrl,
|
||||||
RedirectUrl, RegistrationAccessToken, RegistrationUrl, RequestUrl, ResponseTypes, Scope,
|
PrivateSigningKey, RedirectUrl, RegistrationAccessToken, RegistrationUrl, RequestUrl,
|
||||||
StandardClaims, SubjectIdentifier, TokenUrl, UserInfoUrl,
|
ResponseTypes, Scope, StandardClaims, SubjectIdentifier, TokenUrl, UserInfoUrl,
|
||||||
};
|
};
|
||||||
use rand::{distributions::Alphanumeric, thread_rng, Rng};
|
use rand::{distributions::Alphanumeric, thread_rng, Rng};
|
||||||
use rsa::{pkcs1::ToRsaPrivateKey, RsaPrivateKey};
|
use rsa::{pkcs1::ToRsaPrivateKey, RsaPrivateKey};
|
||||||
@ -54,6 +54,8 @@ pub const CLIENT_PATH: &str = "/client";
|
|||||||
pub const USERINFO_PATH: &str = "/userinfo";
|
pub const USERINFO_PATH: &str = "/userinfo";
|
||||||
pub const SIGNIN_PATH: &str = "/sign_in";
|
pub const SIGNIN_PATH: &str = "/sign_in";
|
||||||
pub const SIWE_COOKIE_KEY: &str = "siwe";
|
pub const SIWE_COOKIE_KEY: &str = "siwe";
|
||||||
|
pub const TOU_PATH: &str = "/legal/terms-of-use.pdf";
|
||||||
|
pub const PP_PATH: &str = "/legal/privacy-policy.pdf";
|
||||||
|
|
||||||
#[cfg(not(target_arch = "wasm32"))]
|
#[cfg(not(target_arch = "wasm32"))]
|
||||||
type DBClientType = (dyn DBClient + Sync);
|
type DBClientType = (dyn DBClient + Sync);
|
||||||
@ -150,7 +152,17 @@ pub fn metadata(base_url: Url) -> Result<CoreProviderMetadata, CustomError> {
|
|||||||
CoreClientAuthMethod::ClientSecretBasic,
|
CoreClientAuthMethod::ClientSecretBasic,
|
||||||
CoreClientAuthMethod::ClientSecretPost,
|
CoreClientAuthMethod::ClientSecretPost,
|
||||||
CoreClientAuthMethod::PrivateKeyJwt,
|
CoreClientAuthMethod::PrivateKeyJwt,
|
||||||
]));
|
]))
|
||||||
|
.set_op_policy_uri(Some(OpPolicyUrl::from_url(
|
||||||
|
base_url
|
||||||
|
.join(PP_PATH)
|
||||||
|
.map_err(|e| anyhow!("Unable to join URL: {}", e))?,
|
||||||
|
)))
|
||||||
|
.set_op_tos_uri(Some(OpTosUrl::from_url(
|
||||||
|
base_url
|
||||||
|
.join(TOU_PATH)
|
||||||
|
.map_err(|e| anyhow!("Unable to join URL: {}", e))?,
|
||||||
|
)));
|
||||||
|
|
||||||
Ok(pm)
|
Ok(pm)
|
||||||
}
|
}
|
||||||
|
@ -17,4 +17,9 @@
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body></body>
|
<body></body>
|
||||||
|
|
||||||
|
<footer>
|
||||||
|
<a href="/legal/privacy-policy.pdf">Privacy Policy</a>
|
||||||
|
<a href="/legal/terms-of-use.pdf">Terms of Use</a>
|
||||||
|
</footer>
|
||||||
</html>
|
</html>
|
||||||
|
BIN
static/legal/privacy-policy.pdf
Normal file
BIN
static/legal/privacy-policy.pdf
Normal file
Binary file not shown.
BIN
static/legal/terms-of-use.pdf
Normal file
BIN
static/legal/terms-of-use.pdf
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user