this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Hopefully the days outlined

+161 -10
+2
shared/challenges_markdown/five/part_one.md
··· 1 + Day five is a only one part one. We talk about jetstream/firehose. A secret account creates a record and they have to 2 + watch create/update to capture the verification code. We hav an added button when clicked it creates the record.
+1
shared/challenges_markdown/four/part_one.md
··· 1 + Day four is the first one is create a tid from a given clock id and date time (random id and time the event started?)
+2
shared/challenges_markdown/four/part_two.md
··· 1 + This will be creating a new did, may end up being a only one part day if this is too difficult. I think it would be we 2 + give them a genis did doc and they give us the did?
+1
shared/challenges_markdown/six/part_one.md
··· 1 + Day six is about XRPC. First up is we have them create an LXM jwt. We validate it's for the correct lxm and did.
+1
shared/challenges_markdown/six/part_two.md
··· 1 + Part 2 is them making an xrpc request and if set properly we give them the day.
+3 -5
shared/challenges_markdown/three/part_one.md
··· 1 - Great job beating Part 1! Now onto Part 2. 2 - 3 - Keeping it simple proof of concept, blah, blah will have a real one here another time. Add a new field `partTwo` to the 4 - record with the value `{{code}}` 5 - 1 + This will be explaing the car format and will have a download link to a car file we create that they can download. 2 + We can create a new web handler like. /day/3/{did} and it downloads the car file. 3 + Inside the car export is just one record with the verficiation code
+2
shared/challenges_markdown/three/part_two.md
··· 1 + This will be them creating a car export with one collection in it and it holds the verification code. We tell them the 2 + collection, rkey, and code to place in it
+37
shared/src/advent/challenges/day_five.rs
··· 1 + use crate::OAuthAgentType; 2 + use crate::advent::day::Day; 3 + use crate::advent::{AdventChallenge, AdventError, ChallengeCheckResponse}; 4 + use async_trait::async_trait; 5 + use sqlx::PgPool; 6 + 7 + pub struct DayFive { 8 + pub pool: PgPool, 9 + pub oauth_client: Option<OAuthAgentType>, 10 + } 11 + 12 + #[async_trait] 13 + impl AdventChallenge for DayFive { 14 + fn pool(&self) -> &PgPool { 15 + &self.pool 16 + } 17 + 18 + fn day(&self) -> Day { 19 + Day::Five 20 + } 21 + 22 + fn has_part_two(&self) -> bool { 23 + false 24 + } 25 + 26 + fn requires_manual_verification_part_one(&self) -> bool { 27 + true 28 + } 29 + 30 + async fn check_part_one( 31 + &self, 32 + _did: String, 33 + _verification_code: Option<String>, 34 + ) -> Result<ChallengeCheckResponse, AdventError> { 35 + todo!() 36 + } 37 + }
+37
shared/src/advent/challenges/day_four.rs
··· 1 + use crate::OAuthAgentType; 2 + use crate::advent::day::Day; 3 + use crate::advent::{AdventChallenge, AdventError, ChallengeCheckResponse}; 4 + use async_trait::async_trait; 5 + use sqlx::PgPool; 6 + 7 + pub struct DayFour { 8 + pub pool: PgPool, 9 + pub oauth_client: Option<OAuthAgentType>, 10 + } 11 + 12 + #[async_trait] 13 + impl AdventChallenge for DayFour { 14 + fn pool(&self) -> &PgPool { 15 + &self.pool 16 + } 17 + 18 + fn day(&self) -> Day { 19 + Day::Four 20 + } 21 + 22 + fn has_part_two(&self) -> bool { 23 + false 24 + } 25 + 26 + fn requires_manual_verification_part_one(&self) -> bool { 27 + true 28 + } 29 + 30 + async fn check_part_one( 31 + &self, 32 + _did: String, 33 + _verification_code: Option<String>, 34 + ) -> Result<ChallengeCheckResponse, AdventError> { 35 + todo!() 36 + } 37 + }
+37
shared/src/advent/challenges/day_six.rs
··· 1 + use crate::OAuthAgentType; 2 + use crate::advent::day::Day; 3 + use crate::advent::{AdventChallenge, AdventError, ChallengeCheckResponse}; 4 + use async_trait::async_trait; 5 + use sqlx::PgPool; 6 + 7 + pub struct DaySix { 8 + pub pool: PgPool, 9 + pub oauth_client: Option<OAuthAgentType>, 10 + } 11 + 12 + #[async_trait] 13 + impl AdventChallenge for DaySix { 14 + fn pool(&self) -> &PgPool { 15 + &self.pool 16 + } 17 + 18 + fn day(&self) -> Day { 19 + Day::Five 20 + } 21 + 22 + fn has_part_two(&self) -> bool { 23 + false 24 + } 25 + 26 + fn requires_manual_verification_part_one(&self) -> bool { 27 + true 28 + } 29 + 30 + async fn check_part_one( 31 + &self, 32 + _did: String, 33 + _verification_code: Option<String>, 34 + ) -> Result<ChallengeCheckResponse, AdventError> { 35 + todo!() 36 + } 37 + }
+3
shared/src/advent/challenges/mod.rs
··· 1 + pub mod day_five; 2 + pub mod day_four; 1 3 pub mod day_one; 4 + pub mod day_six; 2 5 pub mod day_three; 3 6 pub mod day_two;
+35 -5
web/src/handlers/day.rs
··· 8 8 http::StatusCode, 9 9 response::{IntoResponse, Redirect, Response}, 10 10 }; 11 + use shared::advent::challenges::day_five::DayFive; 12 + use shared::advent::challenges::day_four::DayFour; 13 + use shared::advent::challenges::day_six::DaySix; 11 14 use shared::{ 12 15 OAuthAgentType, OAuthClientType, 13 16 advent::ChallengeCheckResponse, ··· 37 40 challenge_agent: state.challenge_agent, 38 41 })), 39 42 Day::Three => Ok(Box::new(DayThree { 43 + pool: state.postgres_pool, 44 + oauth_client, 45 + })), 46 + Day::Four => Ok(Box::new(DayFour { 47 + pool: state.postgres_pool, 48 + oauth_client, 49 + })), 50 + Day::Five => Ok(Box::new(DayFive { 51 + pool: state.postgres_pool, 52 + oauth_client, 53 + })), 54 + Day::Six => Ok(Box::new(DaySix { 40 55 pool: state.postgres_pool, 41 56 oauth_client, 42 57 })), ··· 124 139 .unwrap_or_else(|_| "Error loading part one".to_string()) 125 140 } 126 141 Some(code) => challenge 127 - .markdown_text_part_one(Some(code), current_challenge.additional_context.as_ref()) 142 + .markdown_text_part_one( 143 + Some(code), 144 + current_challenge.additional_context.as_ref(), 145 + ) 128 146 .map(|s| s.to_string()) 129 147 .unwrap_or_else(|_| "Error loading part one".to_string()), 130 148 }, ··· 224 242 .start_challenge(users_did.to_string(), AdventPart::Two) 225 243 .await 226 244 .unwrap(); 227 - let started = challenge.get_days_challenge(&users_did).await.ok().flatten(); 245 + let started = challenge 246 + .get_days_challenge(&users_did) 247 + .await 248 + .ok() 249 + .flatten(); 228 250 let ctx = started.as_ref().and_then(|c| c.additional_context.as_ref()); 229 251 challenge 230 252 .markdown_text_part_two(Some(new_code), ctx) ··· 243 265 .start_challenge(users_did.to_string(), AdventPart::Two) 244 266 .await 245 267 .unwrap(); 246 - let started = challenge.get_days_challenge(&users_did).await.ok().flatten(); 247 - let ctx = started.as_ref().and_then(|c| c.additional_context.as_ref()); 268 + let started = challenge 269 + .get_days_challenge(&users_did) 270 + .await 271 + .ok() 272 + .flatten(); 273 + let ctx = 274 + started.as_ref().and_then(|c| c.additional_context.as_ref()); 248 275 challenge 249 276 .markdown_text_part_two(Some(new_code), ctx) 250 277 .map(|opt| opt.map(|s| s.to_string())) 251 278 .unwrap_or(None) 252 279 } 253 280 Some(code) => challenge 254 - .markdown_text_part_two(Some(code), current_challenge.additional_context.as_ref()) 281 + .markdown_text_part_two( 282 + Some(code), 283 + current_challenge.additional_context.as_ref(), 284 + ) 255 285 .map(|opt| opt.map(|s| s.to_string())) 256 286 .unwrap_or(None), 257 287 }