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
# Project Policy | |
This policy provides a single, authoritative, and machine-readable source of truth for AI coding agents and humans, ensuring that all work is governed by clear, unambiguous rules and workflows. It aims to eliminate ambiguity, reduce supervision needs, and facilitate automation while maintaining accountability and compliance with best practices. | |
# 1. Introduction | |
> Rationale: Sets the context, actors, and compliance requirements for the policy, ensuring all participants understand their roles and responsibilities. | |
## 1.1 Actors |
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 { auth } from "./src/js/nhost.js"; | |
import { initClient, getClient } from "./src/js/graphqlClient.js"; | |
export default { | |
auth: { | |
checkRole: (requiredRole) => { | |
//Used by pageql:authRole directive | |
//Return false if user's role fails to hit specifications | |
//Returning false hides the component |
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 fetch from 'cross-fetch' | |
import jwtDecode from 'jwt-decode' | |
import moment from 'moment' | |
import { NextPageContext } from 'next' | |
import { destroyCookie, parseCookies, setCookie } from 'nookies' | |
export class AuthClient { | |
baseUrl = 'https://backend-[whatev].nhost.app' | |
stateChangeCallbacks: (() => void)[] = [] | |
context?: NextPageContext |
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
<?php | |
// Because I don’t use PHP often enough to remember it instantly | |
$opts = array( | |
'http'=>array( | |
'method'=>"GET", | |
'header'=>"Accept: application/json" | |
) | |
); | |
$context = stream_context_create($opts); |
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
#!/usr/bin/env python | |
import base64 | |
from Crypto import Random | |
from Crypto.Cipher import AES | |
BS = 16 | |
pad = lambda s: s + (BS - len(s) % BS) * chr(BS - len(s) % BS) | |
unpad = lambda s : s[0:-ord(s[-1])] |