Skip to content

Commit

Permalink
Merge pull request #4 from holyhope/login-method/bootstrap
Browse files Browse the repository at this point in the history
feat(login) Add login methods and example
  • Loading branch information
holyhope authored Feb 6, 2024
2 parents fed315a + 289dfad commit 2c60de5
Show file tree
Hide file tree
Showing 42 changed files with 3,476 additions and 110 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,46 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.19'
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
install-mode: "binary"
version: v1.55
args: --timeout=30m

tests:
name: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.19'

- name: Cache browser binaries
id: cache-browser
uses: actions/cache@v3
with:
path: ~/.cache/rod/browser
key: ${{ runner.os }}-rod-browser

- name: Test
run: go test -v ./v1/... -ginkgo.v
env:
DIGIPOSTE_API: ${{ vars.DIGIPOSTE_API }}
DIGIPOSTE_URL: ${{ vars.DIGIPOSTE_URL }}
DIGIPOSTE_USERNAME: ${{ secrets.DIGIPOSTE_USERNAME }}
DIGIPOSTE_PASSWORD: ${{ secrets.DIGIPOSTE_PASSWORD }}
DIGIPOSTE_OTP_SECRET: ${{ secrets.DIGIPOSTE_OTP_SECRET }}

- name: Get debug screenshots
uses: actions/upload-artifact@v3
if: failure()
with:
name: screenshots
path: '**/*.png'
46 changes: 46 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,49 @@ linters:
enable-all: true
disable:
- tagliatelle # Digiposte API is not consistent, it use snake_case and camelCase
- nosnakecase

linters-settings:
# Gci controls Go package import order and makes it always deterministic.
gci:
# Section configuration to compare against.
# Section names are case-insensitive and may contain parameters in ().
# The default order of sections is `standard > default > custom > blank > dot > alias`,
# If `custom-order` is `true`, it follows the order of `sections` option.
# Default: ["standard", "default"]
sections:
- standard # Standard section: captures all standard packages.
- dot # Dot section: contains all dot imports. This section is not present unless explicitly enabled.
- default # Default section: contains all imports that could not be matched to another section type.
- prefix(github.com/holyhope/digiposte-go-sdk) # Custom section: groups all imports with the specified Prefix.
- blank # Blank section: contains all blank imports. This section is not present unless explicitly enabled.

depguard:
# Default: Only allow $gostd in all files.
rules:
# Name of a rule.
main:
files:
- "$all"
- "!$test"
list-mode: lax
allow:
- $gostd
- github.com/chromedp
- github.com/holyhope
- github.com/Davincible/chromedp-undetected
- github.com/go-oauth2/oauth2/v4
- github.com/pquerna/otp

# Name of a rule.
tests:
files:
- "$test"
list-mode: lax
allow:
- $gostd
- github.com/holyhope
- github.com/onsi/ginkgo
- github.com/onsi/gomega
- github.com/go-oauth2/oauth2/v4
- github.com/go-rod/rod/lib/launcher
60 changes: 60 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,63 @@
module github.com/holyhope/digiposte-go-sdk

go 1.19

require (
github.com/Davincible/chromedp-undetected v1.3.8
github.com/chromedp/cdproto v0.0.0-20231205062650-00455a960d61
github.com/chromedp/chromedp v0.9.3
github.com/go-oauth2/oauth2/v4 v4.5.2
github.com/go-rod/rod v0.114.7
github.com/maxbrunsfeld/counterfeiter/v6 v6.7.0
github.com/onsi/ginkgo/v2 v2.13.0
github.com/onsi/gomega v1.30.0
github.com/pquerna/otp v1.4.0
golang.org/x/oauth2 v0.13.0
golang.org/x/time v0.5.0
)

require (
github.com/Xuanwo/go-locale v1.1.0 // indirect
github.com/boombuler/barcode v1.0.1 // indirect
github.com/chromedp/sysutil v1.0.0 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/gobwas/httphead v0.1.0 // indirect
github.com/gobwas/pool v0.2.1 // indirect
github.com/gobwas/ws v1.3.1 // indirect
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/pprof v0.0.0-20231212022811-ec68065c825e // indirect
github.com/google/uuid v1.4.0 // indirect
github.com/gopherjs/gopherjs v1.17.2 // indirect
github.com/gorilla/websocket v1.5.1 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/klauspost/compress v1.17.2 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
github.com/stretchr/testify v1.8.4 // indirect
github.com/tidwall/btree v1.7.0 // indirect
github.com/tidwall/buntdb v1.3.0 // indirect
github.com/tidwall/gjson v1.17.0 // indirect
github.com/tidwall/grect v0.1.4 // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.1 // indirect
github.com/tidwall/rtred v0.1.2 // indirect
github.com/tidwall/tinyqueue v0.1.1 // indirect
github.com/ysmood/fetchup v0.2.3 // indirect
github.com/ysmood/gson v0.7.3 // indirect
github.com/ysmood/leakless v0.8.0 // indirect
golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect
golang.org/x/mod v0.13.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/tools v0.14.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit 2c60de5

Please sign in to comment.