This crate contains the session keys program which can be used by other anchor programs to determine the validity of a session keypair
Program ID: QMj41mN3j168KTuUWNrCgbSAYQ7o9QTaaSnT9gLvW9s
To install, add the following to your Cargo.toml
:
toml
[dependencies]
rayauth-session = "0.1.0"
```rust use rayauthsession::program::RayauthSession; use rayauthsession::SessionKey;
pub struct SessionKeypairIx<'info> { #[account(mut)] pub payer: Signer<'info>, #[account( seeds = [SessionKey::SEEDPREFIX.asref(), huntersigner.sessionkey.asref()], seeds::program = RayauthSession::id(), bump, constraint = signerkey.isvalid()? == true, // check if the session key has expired or not constraint = signerkey.sessionkey == signer.key(), // checks if the signer is valid )] pub signerkey: Account<'info, SessionKey>, pub signer: Signer<'info>, } ```