Skip to content

Commit

Permalink
Remove PKCE scopes
Browse files Browse the repository at this point in the history
Signed-off-by: Austin Liu <[email protected]>
  • Loading branch information
austin362667 committed Oct 20, 2024
1 parent 0831751 commit eb7b696
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 18 deletions.
6 changes: 4 additions & 2 deletions flyteidl/src/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,10 @@ pub mod auth {
.oauth_client
.authorize_url(CsrfToken::new_random)
// Set the desired scopes.
.add_scope(Scope::new("all".to_string()))
.add_scope(Scope::new("offline".to_string()))
// .add_scope(Scope::new("offline_access".to_string()))
// .add_scope(Scope::new("offline".to_string()))
// .add_scope(Scope::new("all".to_string()))
// .add_scope(Scope::new("openid".to_string()))
// Set the PKCE code challenge.
.set_pkce_challenge(pkce_challenge)
.url();
Expand Down
32 changes: 16 additions & 16 deletions flyteidl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -977,22 +977,22 @@ pub mod _flyteidl_rust {
let mut access_token: String = "".to_string();
if !insecure {
let cert: Certificate = auth::auth::bootstrap_creds_from_server(&endpoint_uri);
let tls: ClientTlsConfig = ClientTlsConfig::new()
.ca_certificate(cert)
.domain_name((*endpoint).to_string());

let channel = match rt.block_on(
Channel::builder(endpoint_uri.clone())
.tls_config(tls)
.unwrap()
.connect(),
) {
Ok(ch) => ch,
Err(error) => panic!(
"Failed at connecting to endpoint when constructing secured channel: {:?}",
error
),
};
// let tls: ClientTlsConfig = ClientTlsConfig::new()
// .ca_certificate(cert)
// .domain_name((*endpoint).to_string());

// let channel = match rt.block_on(
// Channel::builder(endpoint_uri.clone())
// .tls_config(tls)
// .unwrap()
// .connect(),
// ) {
// Ok(ch) => ch,
// Err(error) => panic!(
// "Failed at connecting to endpoint when constructing secured channel: {:?}",
// error
// ),
// };

let mut oauth_client: auth::auth::OAuthClient = auth::auth::OAuthClient::new(
endpoint,
Expand Down

0 comments on commit eb7b696

Please sign in to comment.