Skip to content

feat: add support for apple authentication #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rupansh-sekar-yral
Copy link
Contributor

Copy link
Contributor

@komal-sai-yral komal-sai-yral left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one question.

Comment on lines +162 to +177
let cur_exp = self.cache_expiry_epoch_secs.load(Ordering::Acquire);
if cur_epoch < cur_exp {
return self.cache.read().unwrap().clone();
}

let mut cache = self.cache.write().unwrap();
let (client_secret, expiry_epoch) = self.keygen.generate_client_secret();

let new_client = cache
.as_ref()
.clone()
.set_client_secret(client_secret.clone());
let new_client = Arc::new(new_client);
*cache = new_client.clone();
self.cache_expiry_epoch_secs
.store(expiry_epoch, Ordering::Release);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One question - Do the Acquire/Release act as mutex here and is .load(Ordering::Acquire) a blocking operation for threads ? else I think after expiry we will regenerate secrets multiple times.

Also is that a concern for us if that happens.

nomicon is confusing - https://doc.rust-lang.org/nomicon/atomics.html#acquire-release
will prolly go through https://marabos.nl/atomics/memory-ordering.html#release-and-acquire-ordering and https://youtu.be/rMGWeSjctlY?list=PLqbS7AVVErFiWDOAVrPt7aYmnuuOLYvOa over the weekend

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Product Feature Request] Apple ID Login API for iOS App
3 participants