Skip to content

Instantly share code, notes, and snippets.

@powerman
powerman / create-local-CA.md
Last active May 7, 2024 01:23
Create local CA to issue localhost HTTPS certificates

Create local CA to issue localhost HTTPS certificates

You can check How to securely test local/staging HTTPS project for more details about required setup or just follow instructions below.

WARNING: You'll need to run these commands just once, don't run them again if you already did this before for some other project.

MacOS users should first prepare OpenSSL package:

@powerman
powerman / chan_queue.go
Created June 20, 2021 16:35
Helper for buffering data from non-blocking channel for sending into blocking channel
// Usage example:
func process(in <-chan Msg, outBlocking chan<- Msg) {
out := newQueueMsg(QueueSize, outBlocking)
for {
select {
case msg := <-in:
out.append(msg)
case out.C <- out.Elem:
out.del()
}
@powerman
powerman / OAuth 2.0.adoc
Created June 25, 2022 18:34
Recommendations on secure implementation of OAuth 2.0 (server and client)

OAuth 2.0

Table of Contents

Abstract

@powerman
powerman / WORKFLOWS_OTHER_TOKEN.md
Last active June 13, 2025 14:31
How to properly support optional secrets.OTHER_TOKEN instead of GitHub default token in GitHub Actions workflows

How to properly support optional secrets.OTHER_TOKEN instead of GitHub default token in GitHub Actions workflows

Caller workflow

✅ DO:

env:
  GITHUB_TOKEN: ${{ secrets.OTHER_TOKEN || github.token }}

jobs: