This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use anyhow::{Context, Result}; | |
use cobalt_aws::s3; | |
use futures::io::AsyncReadExt; | |
use tokio::runtime::Runtime; | |
fn main() -> Result<()> { | |
// This "block_on" magic lets you execute an "async" function without having | |
// to worry about making all of the surrounding code also be an "async" function. | |
let config = Runtime::new()?.block_on( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Have one error class that exposed by UniFFI, defined in your `.udl` file | |
// and with a correspondong struct definition in `lib.rs`. It's flat, because | |
// UniFFI doesn't pass nice nested structure in errors (yet). | |
// | |
// Instances of this error will only ever appear on the boundary of your API, | |
// where they get handed off to the foreign-language code. | |
// | |
pub enum LoginsError { | |
UnexpectedLoginsStorageError(String), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"type": "account-ecosystem-main", | |
"payload": { | |
"ecosystemClientId": "4f6f83cc-4e63-4185-924a-0e89ce4222de", | |
"ecosystemDeviceId": "1883fd2a-2096-4ade-904b-ed769bf2a9a9", | |
"ecosystemAnonId": "eyJhbGciOiJFQ0RILUVTIiwiZW5jIjoiQTI1NkdDTSIsImVwayI6eyJjcnYiOiJQLTI1NiIsImV4dCI6dHJ1ZSwia3R5IjoiRUMiLCJ4IjoiazByWWVzOVlKb0w1QWdxeVZCVmViNk4xekVlcnItLVQtazVVNHFoOHFTNCIsInkiOiJBaGl3Vy1JdGZ6X0lzdUZFWmhCSHNKNl9XYVdVcHdpUDJobEVMYXN0dTQwIn19..B-GwRcb_5Ii1c3N1.XnFTMM9vFJSLnl3QhQuNC9oLlB-NFteAEJhK1_5xSFM.TV6Gs_tbYek6NJe48eWo3Q", | |
"previousEcosystemAnonIds": [], | |
}, | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
05-27 18:05:13.144 25309 25410 I sync15::sync_multiple: Syncing history engine! | |
05-27 18:05:13.144 25309 25410 I sync15::sync: Syncing collection history | |
05-27 18:05:14.712 25309 25410 I sync15::client: Successful request to "/1.5/137697556/storage/history", incoming x-last-modified=ServerTimestamp(1590566116750) | |
05-27 18:05:15.068 25309 25410 I sync15::sync: Downloaded 5000 remote changes (request 0 of 1) | |
05-27 18:05:15.243 25309 25401 D SyncWorker: Starting sync... Tagged as: [Immediate, mozilla.components.service.fxa.sync.WorkManagerSyncWorker, Common] | |
05-27 18:05:15.243 25309 25401 D sync_manager_ffi: sync_manager_set_places | |
05-27 18:05:16.563 25309 25410 D places::db::tx::coop_transaction: ChunkedCoopTransaction commiting after taking allocated time | |
05-27 18:05:17.994 25309 25410 D places::db::tx::coop_transaction: ChunkedCoopTransaction commiting after taking allocated time | |
05-27 18:05:19.083 25309 25410 D places::db::tx::coop_transaction: ChunkedCoopTransaction commiting after taking allocated time | |
05- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from collections import defaultdict | |
with open(sys.argv[1]) as f: | |
lines = (ln.strip() for ln in f) | |
# Skip headers. | |
assert next(lines).startswith("File") | |
# Sum up serde-related things vs total. | |
totalSize = 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
with open(sys.argv[1]) as f: | |
lines = (ln.strip() for ln in f) | |
# Skip headers. | |
assert next(lines).startswith("Lines") | |
assert next(lines).startswith("-----") | |
assert next(lines).endswith("(TOTAL)") | |
# Sum up serde-related things vs total. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// This is a JavaScript implementation of (an approximate subset of) | |
// the Noise Protocol Framework [1], using the WebCrypto API. | |
// | |
// It's not spec-compliant but it aims to be about as close as we | |
// can possibly get. Key points of divergence: | |
// | |
// * Uses P-256 rather than Curve25519 for ECDH, since Curve25519 | |
// is not available in WebCrypto. | |
// |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script src="http://code.jquery.com/jquery-3.2.1.min.js" | |
integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" | |
crossorigin="anonymous"></script> | |
<script type="text/javascript"> | |
// UI code to hook up buttons etc. | |
$(function() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import time | |
import argparse | |
import multiprocessing | |
import psutil | |
import pymysql | |
parser = argparse.ArgumentParser() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# To run this script, you'll need to install some dependencies: | |
# | |
# $> pip instal hkdf jwcrypto crockford | |
# | |
# Then you can run it without arguments, and it will print out | |
# a series of test vectors for checking compatibility of other | |
# implementations of Recovery Keys. | |
# | |
# $> python ./recovery_key_test_vectors.py |
NewerOlder