pub struct RefreshRequest {
pub refresh_token: Secret,
pub client_id: String,
pub scopes: Vec<String>,
}Expand description
What to refresh: a refresh token, plus the client and scopes to post with it.
use ccwire_oauth::{RefreshRequest, Secret};
let req = RefreshRequest::new(Secret::new("stored-refresh-token"))
.scopes(["user:profile", "user:inference"]);
assert_eq!(req.scope_string(), "user:profile user:inference");Fields§
§refresh_token: SecretThe refresh token.
client_id: StringThe OAuth client id. Default CLAUDE_CODE_CLIENT_ID.
scopes: Vec<String>The scopes to ask for. Default DEFAULT_SCOPES; pass the stored
login’s scopes when it has them.
Implementations§
Source§impl RefreshRequest
impl RefreshRequest
Sourcepub fn new(refresh_token: Secret) -> Self
pub fn new(refresh_token: Secret) -> Self
A request for refresh_token with the default client and scopes.
Sourcepub fn scopes<I, S>(self, scopes: I) -> Self
pub fn scopes<I, S>(self, scopes: I) -> Self
Sets the scopes. An empty list keeps the defaults.
Sourcepub fn scope_string(&self) -> String
pub fn scope_string(&self) -> String
The scopes as the token endpoint takes them: space-separated.
Trait Implementations§
Source§impl Clone for RefreshRequest
impl Clone for RefreshRequest
Auto Trait Implementations§
impl Forget for RefreshRequest
impl Freeze for RefreshRequest
impl RefUnwindSafe for RefreshRequest
impl Send for RefreshRequest
impl Sync for RefreshRequest
impl Unpin for RefreshRequest
impl UnsafeUnpin for RefreshRequest
impl UnwindSafe for RefreshRequest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more