Skip to content

Instantly share code, notes, and snippets.

View Recodify's full-sized avatar

Sam Recodify

View GitHub Profile
@Recodify
Recodify / gist:f0f6785a58df630606778be873e74027
Created September 2, 2025 23:44
Dump OpenId Connect Token Claims From Github Action
## Useful for debugging aws deploy role/perm issues
- name: Dump OIDC token claims
id: oidc
uses: actions/github-script@v7
with:
script: |
const token = await core.getIDToken('sts.amazonaws.com');
const payload = JSON.parse(Buffer.from(token.split('.')[1], 'base64').toString());
core.info(`sub=${payload.sub}`);
// ------------------------------------------------------------------------------
// <auto-generated>
//Generated by avrogen, version 1.7.7.5
//Changes to this file may cause incorrect behavior and will be lost if code
//is regenerated
// </auto-generated>
// ------------------------------------------------------------------------------
namespace homelync
{
using System;
@Recodify
Recodify / SecuredPassword.cs
Last active January 1, 2016 14:59
A persistence unaware securely hashed password using Rrc2898DeriveBytes. Both the hashed password and the generated salt should be persisted.
public class SecuredPassword
{
private const int saltSize = 256;
private readonly byte[] hash;
private readonly byte[] salt;
public byte[] Hash
{
get { return hash; }
}
@Recodify
Recodify / HttpRequestExtensions.cs
Last active January 1, 2016 14:59
The following extension method on HttpRequest will create a string that can be pasted into fiddler (or used in a curl request) and replayed.
namespace System.Web
{
using System.IO;
/// <summary>
/// Extension methods for HTTP Request.
/// <remarks>
/// See the HTTP 1.1 specification http://www.w3.org/Protocols/rfc2616/rfc2616.html
/// for details of implementation decisions.
/// </remarks>