Skip to content

Commit d2b7a49

Browse files
chore: split from foundations
0 parents  commit d2b7a49

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+3857
-0
lines changed

.github/workflows/test.yaml

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
go-version: [ '1.22.x' ]
14+
15+
services:
16+
postgres:
17+
image: postgres
18+
env:
19+
POSTGRES_PASSWORD: local
20+
POSTGRES_USER: local
21+
POSTGRES_DB: local
22+
options: >-
23+
--health-cmd pg_isready
24+
--health-interval 10s
25+
--health-timeout 5s
26+
--health-retries 5
27+
ports:
28+
- 5432:5432
29+
30+
steps:
31+
- uses: actions/checkout@v4
32+
- name: Setup Go ${{ matrix.go-version }}
33+
uses: actions/setup-go@v5
34+
with:
35+
go-version: ${{ matrix.go-version }}
36+
37+
- name: Restore Cache
38+
uses: actions/cache@v4
39+
with:
40+
path: |
41+
~/.cache/go-build
42+
~/go/pkg/mod
43+
key: ${{ runner.os }}-v1-go-${{ hashFiles('**/go.sum') }}
44+
restore-keys: |
45+
${{ runner.os }}-go-
46+
47+
- name: Run Tests
48+
run: go test -v ./...
49+
50+
lint:
51+
name: lint
52+
runs-on: ubuntu-latest
53+
steps:
54+
- uses: actions/checkout@v4
55+
- uses: actions/setup-go@v5
56+
with:
57+
go-version: stable
58+
- name: golangci-lint
59+
uses: golangci/golangci-lint-action@v6
60+
with:
61+
version: v1.58

.gitignore

+235
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,235 @@
1+
# Created by https://www.toptal.com/developers/gitignore/api/macos,go,vim,linux,node
2+
# Edit at https://www.toptal.com/developers/gitignore?templates=macos,go,vim,linux,node
3+
4+
### Go ###
5+
# If you prefer the allow list template instead of the deny list, see community template:
6+
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
7+
#
8+
# Binaries for programs and plugins
9+
*.exe
10+
*.exe~
11+
*.dll
12+
*.so
13+
*.dylib
14+
15+
# Test binary, built with `go test -c`
16+
*.test
17+
18+
# Output of the go coverage tool, specifically when used with LiteIDE
19+
*.out
20+
21+
# Dependency directories (remove the comment below to include it)
22+
# vendor/
23+
24+
# Go workspace file
25+
go.work
26+
27+
### Linux ###
28+
*~
29+
30+
# temporary files which can be created if a process still has a handle open of a deleted file
31+
.fuse_hidden*
32+
33+
# KDE directory preferences
34+
.directory
35+
36+
# Linux trash folder which might appear on any partition or disk
37+
.Trash-*
38+
39+
# .nfs files are created when an open file is removed but is still being accessed
40+
.nfs*
41+
42+
### macOS ###
43+
# General
44+
.DS_Store
45+
.AppleDouble
46+
.LSOverride
47+
48+
# Icon must end with two \r
49+
Icon
50+
51+
52+
# Thumbnails
53+
._*
54+
55+
# Files that might appear in the root of a volume
56+
.DocumentRevisions-V100
57+
.fseventsd
58+
.Spotlight-V100
59+
.TemporaryItems
60+
.Trashes
61+
.VolumeIcon.icns
62+
.com.apple.timemachine.donotpresent
63+
64+
# Directories potentially created on remote AFP share
65+
.AppleDB
66+
.AppleDesktop
67+
Network Trash Folder
68+
Temporary Items
69+
.apdisk
70+
71+
### macOS Patch ###
72+
# iCloud generated files
73+
*.icloud
74+
75+
### Node ###
76+
# Logs
77+
logs
78+
*.log
79+
npm-debug.log*
80+
yarn-debug.log*
81+
yarn-error.log*
82+
lerna-debug.log*
83+
.pnpm-debug.log*
84+
85+
# Diagnostic reports (https://nodejs.org/api/report.html)
86+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
87+
88+
# Runtime data
89+
pids
90+
*.pid
91+
*.seed
92+
*.pid.lock
93+
94+
# Directory for instrumented libs generated by jscoverage/JSCover
95+
lib-cov
96+
97+
# Coverage directory used by tools like istanbul
98+
coverage
99+
*.lcov
100+
101+
# nyc test coverage
102+
.nyc_output
103+
104+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
105+
.grunt
106+
107+
# Bower dependency directory (https://bower.io/)
108+
bower_components
109+
110+
# node-waf configuration
111+
.lock-wscript
112+
113+
# Compiled binary addons (https://nodejs.org/api/addons.html)
114+
build/Release
115+
116+
# Dependency directories
117+
node_modules/
118+
jspm_packages/
119+
120+
# Snowpack dependency directory (https://snowpack.dev/)
121+
web_modules/
122+
123+
# TypeScript cache
124+
*.tsbuildinfo
125+
126+
# Optional npm cache directory
127+
.npm
128+
129+
# Optional eslint cache
130+
.eslintcache
131+
132+
# Optional stylelint cache
133+
.stylelintcache
134+
135+
# Microbundle cache
136+
.rpt2_cache/
137+
.rts2_cache_cjs/
138+
.rts2_cache_es/
139+
.rts2_cache_umd/
140+
141+
# Optional REPL history
142+
.node_repl_history
143+
144+
# Output of 'npm pack'
145+
*.tgz
146+
147+
# Yarn Integrity file
148+
.yarn-integrity
149+
150+
# dotenv environment variable files
151+
.env
152+
.env.development.local
153+
.env.test.local
154+
.env.production.local
155+
.env.local
156+
157+
# parcel-bundler cache (https://parceljs.org/)
158+
.cache
159+
.parcel-cache
160+
161+
# Next.js build output
162+
.next
163+
out
164+
165+
# Nuxt.js build / generate output
166+
.nuxt
167+
dist
168+
169+
# Gatsby files
170+
.cache/
171+
# Comment in the public line in if your project uses Gatsby and not Next.js
172+
# https://nextjs.org/blog/next-9-1#public-directory-support
173+
# public
174+
175+
# vuepress build output
176+
.vuepress/dist
177+
178+
# vuepress v2.x temp and cache directory
179+
.temp
180+
181+
# Docusaurus cache and generated files
182+
.docusaurus
183+
184+
# Serverless directories
185+
.serverless/
186+
187+
# FuseBox cache
188+
.fusebox/
189+
190+
# DynamoDB Local files
191+
.dynamodb/
192+
193+
# TernJS port file
194+
.tern-port
195+
196+
# Stores VSCode versions used for testing VSCode extensions
197+
.vscode-test
198+
199+
# yarn v2
200+
.yarn/cache
201+
.yarn/unplugged
202+
.yarn/build-state.yml
203+
.yarn/install-state.gz
204+
.pnp.*
205+
206+
### Node Patch ###
207+
# Serverless Webpack directories
208+
.webpack/
209+
210+
# Optional stylelint cache
211+
212+
# SvelteKit build / generate output
213+
.svelte-kit
214+
215+
### Vim ###
216+
# Swap
217+
[._]*.s[a-v][a-z]
218+
!*.svg # comment out if you don't need vector files
219+
[._]*.sw[a-p]
220+
[._]s[a-rt-v][a-z]
221+
[._]ss[a-gi-z]
222+
[._]sw[a-p]
223+
224+
# Session
225+
Session.vim
226+
Sessionx.vim
227+
228+
# Temporary
229+
.netrwhist
230+
# Auto-generated tag files
231+
tags
232+
# Persistent undo
233+
[._]*.un~
234+
235+
# End of https://www.toptal.com/developers/gitignore/api/macos,go,vim,linux,node

.test.env

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
DATABASE_URI="postgresql://local:local@localhost:5432/local?sslmode=disable"
2+

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024-present inout labs OÜ
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# shield
2+
Shield is a comprehensive opinionated authentication framework for Go, built on Postgres.
3+
4+
It is built on top of sqlc, pgx and supporting SSO, MFA out of the box.
5+
6+
There is no intention to adapt this framework for other stacks.
7+
8+
## LICENSE
9+
10+
MIT Licensed

0 commit comments

Comments
 (0)