pub struct AuthGrant {
pub app: usize,
pub challenge: String,
pub method: PkceChallengeMethod,
pub token: String,
pub last_updated: usize,
pub scopes: Vec<AppScope>,
}Fields§
§app: usizeThe ID of the application associated with this grant.
challenge: StringThe code challenge for PKCE verifiers associated with this grant.
This challenge is all that is required to refresh this grant’s auth token. While there can only be one token at a time, it can be refreshed whenever as long as the provided verifier matches that of the challenge.
The challenge should never be changed. To change the challenge, the grant should be removed and recreated.
method: PkceChallengeMethodThe encoding method for the initial verifier in the challenge.
token: StringThe access token associated with the account. This is not the same as
regular account access tokens, as the token can only be used with the requested scopes.
last_updated: usizeThe time in which the token was last refreshed. Tokens should stop being accepted after a week has passed since this time.
scopes: Vec<AppScope>Scopes define what the grant’s token is actually allowed to do.
No scope shall ever be allowed to change scopes or manage grants on behalf of the user. A regular user token must be provided to manage grants.
Implementations§
Source§impl AuthGrant
impl AuthGrant
Sourcepub fn check_verifier(&self, verifier: &str) -> Result<()>
pub fn check_verifier(&self, verifier: &str) -> Result<()>
Check a verifier against the stored challenge (using the given PkceChallengeMethod).