Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V2: Initial API #13

Merged
merged 155 commits into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
155 commits
Select commit Hold shift + click to select a range
bf9a241
Types: Move public types to one file
jwijenbergh Mar 20, 2023
75b479a
Client: Add functions to convert to public types
jwijenbergh Mar 20, 2023
1a546b3
Client FSM: Remove states that are client specific/not in the lib
jwijenbergh Mar 20, 2023
c59b86e
Client Server: Convert from external to internal types and vice versa
jwijenbergh Mar 20, 2023
0165005
FSM: Add state name to transition error
jwijenbergh Mar 20, 2023
0d60c04
FSM: Set handled to true for now
jwijenbergh Mar 20, 2023
5d075d6
Server Base: Add functions for getting expiry times
jwijenbergh Mar 20, 2023
58f1339
Institute Access: Add context to set errors
jwijenbergh Mar 20, 2023
ca6fc0c
Util: Get rid of language matching
jwijenbergh Mar 20, 2023
9d6d736
Server: Add a TODO note for custom server types
jwijenbergh Mar 20, 2023
4168f8e
Exports: Remove server.h
jwijenbergh Apr 26, 2023
25a21dc
Exports: Implement initial V2 API
jwijenbergh Mar 20, 2023
aec0fae
Wrappers Python: Implement V2 initial API
jwijenbergh Mar 20, 2023
82493de
Types: Split protocol into its own
jwijenbergh Mar 20, 2023
8c1d164
Format: Run gofumpt
jwijenbergh Mar 20, 2023
dd56785
Types: Split discovery into its own package
jwijenbergh Mar 20, 2023
2a068c8
Types: Split server into subpackage
jwijenbergh Mar 20, 2023
1709a1e
Exports + Python: Use an enum for server type
jwijenbergh Mar 20, 2023
f0190dd
Client: Remove servers argument to transition
jwijenbergh Mar 20, 2023
ec43b21
Types Server: Remove identifier from profile
jwijenbergh Mar 20, 2023
84e3cbf
Wrappers Python: Document handler in register
jwijenbergh Mar 20, 2023
89efb59
Client: Check if the base time is zero when getting expiry times
jwijenbergh Mar 20, 2023
ce94cb3
CMD CLI: Update to V2 API
jwijenbergh Mar 20, 2023
015af9e
Tests: Pass for V2 API
jwijenbergh Mar 20, 2023
6aef5aa
Exports + Python + Server: Remove ShouldRenewButton
jwijenbergh Mar 20, 2023
d5ceb27
Doc: Update document for initial V2 API
jwijenbergh Mar 21, 2023
8b6a30d
Doc: Update for expiry times and errors
jwijenbergh Mar 21, 2023
e833055
Revert "FSM: Set handled to true for now"
jwijenbergh Mar 21, 2023
a5d90fa
FSM: Add more context to required transition error
jwijenbergh Mar 21, 2023
4df067f
Docs: Remove outdated documents
jwijenbergh Mar 21, 2023
6bb7d22
Exports + Python: Compare booleans with != 0 instead of == 1
jwijenbergh Mar 21, 2023
ad71807
Docs API: Add more state explanation
jwijenbergh Mar 21, 2023
0d701b0
Docs API: Fix Got Config description
jwijenbergh Mar 21, 2023
12dd28e
Python Tests: Handle OAuth Started transition
jwijenbergh Mar 21, 2023
86a2b8d
Types: Add comments describing the fields, types, packages and funct…
jwijenbergh Mar 21, 2023
39b637f
Exports: Return nil on nil error
jwijenbergh Mar 21, 2023
c74c551
Docs API: Fix go boolean, add errors section and renew transition
jwijenbergh Mar 21, 2023
979d030
Docs Debugging: Update FSM SVG
jwijenbergh Mar 21, 2023
f47a65b
Docs Debugging: Link to API staates
jwijenbergh Mar 21, 2023
0f6624d
Docs API: Update links to .md
jwijenbergh Mar 21, 2023
25902fd
Docs + Types server: Add comments about script-security
jwijenbergh Mar 21, 2023
44a46a6
Wrappers Python: Delete version number requirements
jwijenbergh Mar 21, 2023
423d1a7
Docs API: Add link to types/server
jwijenbergh Mar 21, 2023
fe0df07
API Overview: Add notes about freeing and deregistering
jwijenbergh Mar 21, 2023
5a374f3
API Overview: Typos
jwijenbergh Mar 21, 2023
1139974
Exports + Client Register: Make sure to only update state if no err
jwijenbergh Mar 22, 2023
c5b182a
Exports + Client: Refactor registering a client
jwijenbergh Mar 22, 2023
90d75f1
Fix connection monitoring on Windows
rozmansi Mar 23, 2023
b7e6022
Wrappers Python: Separate BoolError data type to get rid of decode_func
jwijenbergh Mar 23, 2023
8902e5a
Client: Remove OpenVPN check for failover and check if in progress
jwijenbergh Mar 30, 2023
7f6e172
Client: failover cancel error should be lowercase
jwijenbergh Mar 30, 2023
8e8f0ff
Client: Improve Let's Connect! not supported errors
jwijenbergh Mar 30, 2023
a3549b1
Discovery: Pass a context around
jwijenbergh Apr 12, 2023
ab01ca1
Format: Run gofumpt (Go) + black (py)
jwijenbergh Apr 12, 2023
05c5eba
Types Server: Pass locations to secure internet
jwijenbergh Apr 12, 2023
e1e533c
Failover: Pass a context around
jwijenbergh Apr 12, 2023
c592054
OAuth: Pass a context around
jwijenbergh Apr 12, 2023
a0d6899
HTTP: Pass context around and optionally trail path in url
jwijenbergh Apr 12, 2023
a202465
Refactor: Split internal server into multiple packages
jwijenbergh Apr 12, 2023
f4cf03b
OAuth: Implement the Public() method for tokens
jwijenbergh Apr 12, 2023
ab7d71b
Types: Add a new cookie type
jwijenbergh Apr 12, 2023
d31c2de
Types Server: Implement required ask transition needed for client
jwijenbergh Apr 12, 2023
55bfb58
Refactor: Move client implementation to one file
jwijenbergh Apr 12, 2023
8fc11fc
Wrappers Python: Update to newest API by implementing cookies
jwijenbergh Apr 12, 2023
5c9a921
Exports: Implement newest API using cookie handlers
jwijenbergh Apr 12, 2023
08c1292
CLI: Implement newest API using cookies
jwijenbergh Apr 12, 2023
7d555b7
Exports: Remove token updater
jwijenbergh Apr 26, 2023
0bd8e1f
Python: Get rid of token callback
jwijenbergh Apr 26, 2023
89098d3
All: Implement a token handler
jwijenbergh Apr 13, 2023
96da9d1
Exports: Fix void signature for TokenGetter
jwijenbergh Apr 17, 2023
17b2f1c
Client: Re-create failover object on new call
jwijenbergh Apr 17, 2023
d0bab19
Wrappers Python: Get rid of optional as return
jwijenbergh Apr 24, 2023
0709f5e
Server: Support unmarshalling server as a string
jwijenbergh Apr 24, 2023
bd32736
Client: Return on refresh endpoints context error
jwijenbergh Apr 26, 2023
3c9fa15
Client: Fix institute servers map typo
jwijenbergh Apr 26, 2023
7731bd9
Client: Relax state requirements for No Server on add
jwijenbergh Apr 26, 2023
fe96f29
Custom: Use the hostname for custom servers display name
jwijenbergh Apr 26, 2023
5533096
OAuth Token: Set previous refresh token if new refresh token is empty
jwijenbergh Apr 17, 2023
18fb0f1
Verify Test: Use callStr on error
jwijenbergh Apr 17, 2023
a5d44b5
Secure: Do not set current location as it is already done
jwijenbergh Apr 26, 2023
e796d55
Version: Update to 2.0.0
jwijenbergh Apr 26, 2023
0ed1e4c
Exports: Remove unused error.h
jwijenbergh Apr 28, 2023
9165d53
Exports: Lowercase statecallback
jwijenbergh Apr 28, 2023
5bb555f
Exports: Initial comments documenting the API
jwijenbergh Apr 28, 2023
95cbf7e
Exports: Document getconfig prefer TCP and return type
jwijenbergh Apr 28, 2023
1d69201
Exports: Small fixes in cookie comments
jwijenbergh Apr 28, 2023
50b1316
Exports: Fix function name for DiscoOrganizations in comments
jwijenbergh Apr 28, 2023
7e0ab5e
Exports: Document AddServer ni flag
jwijenbergh May 1, 2023
b7d8ed2
Client: Do not defer NoServer transition when noninteractive
jwijenbergh May 1, 2023
ceb7803
Workflows: Add mermaid support for mdbook
jwijenbergh May 1, 2023
4c215e5
Docs: Update API section for V2
jwijenbergh May 1, 2023
c44ed27
Docs: Increase the content width
jwijenbergh May 1, 2023
c14804e
Docs: Move state machine to API
jwijenbergh May 1, 2023
3ccfb74
Docs: Only increase the width for the state machine
jwijenbergh May 1, 2023
8304ae6
Docs: Set mermaid theme to neutral
jwijenbergh May 1, 2023
716b1d3
Docs: API fix link and spelling in adding a server
jwijenbergh May 1, 2023
ba73a8a
Docs: Small typos
jwijenbergh May 1, 2023
b8d0a91
Endpoints: Double check HTTPS scheme
jwijenbergh May 2, 2023
9156cb6
API Test: Add test for invalid authorization endpoint scheme
jwijenbergh May 2, 2023
3285f85
CLI: Open the browser again with pkg/browser
jwijenbergh May 2, 2023
a0b2a9b
OAuth: Always set the scheme to HTTPS for the authorization URL
jwijenbergh May 2, 2023
0250c42
Exports: Document that CookieReply can be done in the background
jwijenbergh May 2, 2023
83ec784
Types Discovery: Omitempty for some types that are not always there
jwijenbergh May 2, 2023
1b97d5e
Client: Remove Got Config state check for current server
jwijenbergh May 2, 2023
8a76bfb
Client + Types: Expose support contact
jwijenbergh May 3, 2023
af7e9df
Client + OAuth + Server: Initialize the OAuth clientID on add
jwijenbergh May 15, 2023
5a119ec
Discovery: Ignore embeded discovery files
rozmansi Mar 22, 2023
af667f3
Client: Disable identifier conversion for secure internet
jwijenbergh May 17, 2023
a1b5175
Client + FSM: Check transitions and add SetState
jwijenbergh May 2, 2023
47a54d9
Client FSM: Add extra optional states about VPN connectivity
jwijenbergh May 8, 2023
f9f3518
Client: Use a mutex for state transitions
jwijenbergh May 8, 2023
7d512d0
Client FSM: Allow client to ask location in NoServer
jwijenbergh May 8, 2023
617ee73
FSM: Allow to always go back to the initial state
jwijenbergh May 9, 2023
a30709a
Client: Call Deregistered transition on Deregister()
jwijenbergh May 9, 2023
12af0d9
Initial i18n implementation
jwijenbergh May 15, 2023
9c60e2e
Wrappers Python: Add back event handler
jwijenbergh May 26, 2023
8f02cb9
Wrappers Python: Use class callback handler
jwijenbergh May 26, 2023
942ef53
Client Test: Remove OAuth parameter tests
jwijenbergh May 26, 2023
be60a89
Docker: Update Fedora from 36 to 38
jwijenbergh May 26, 2023
4aba32c
Docs API: Move from handler to class based transitions in tutorial
jwijenbergh May 26, 2023
c9774bd
Client i18n: Add Slovenia
jwijenbergh May 26, 2023
377e264
Client: Save internal state regularly
jwijenbergh May 31, 2023
c4e1fd3
Client: Added Slovenian localization from Weblate
jwijenbergh Jun 2, 2023
a3f69e2
Add a script to update translations from weblate
jwijenbergh Jun 2, 2023
a590706
Client: Remove bogus chosen server transition for renew
jwijenbergh Jun 5, 2023
c000261
Client FSM: Add loading server to authorized
jwijenbergh Jun 5, 2023
4db7bae
Client Test: Only use temporary directories
jwijenbergh Jun 6, 2023
b585ffc
gitignore: Add some paths
jwijenbergh Jun 6, 2023
2fe227f
Client FSM: Allow self-transition to No Server
jwijenbergh Jun 13, 2023
70a82bb
i18n: Expand variadic args slice in printer sprintf
jwijenbergh Jul 10, 2023
0301bc3
Client: Return immediately on profile validity check error
jwijenbergh Jul 14, 2023
b385fad
Client: Be less strict on chosen server transition
jwijenbergh Jul 14, 2023
bb9296b
CI Docker: Update go to latest version
jwijenbergh Aug 16, 2023
c54e45a
Client + Exports + Python: Add a startup boolean to getconfig
jwijenbergh Aug 16, 2023
6c0a660
Client: Update translations from Weblate
jwijenbergh Aug 16, 2023
7341729
Locales: Add a script to sync translations and use it
jwijenbergh Aug 16, 2023
83b389d
Sync translations: fix shellcheck warning
jwijenbergh Aug 16, 2023
204162e
README: Add weblate info
jwijenbergh Aug 16, 2023
1397b13
Client: Update translations from Weblate
jwijenbergh Aug 16, 2023
a64f684
Client + l18n: Make some errors internal only
jwijenbergh Aug 16, 2023
0570159
Client: Update translations from Weblate
jwijenbergh Aug 16, 2023
19dcdd2
Server: Set OAuth endpoints on refresh
jwijenbergh Aug 28, 2023
14af66c
Wrappers Python: Remove translations print
jwijenbergh Aug 28, 2023
fedfe3b
go.mod/go.sum: update
jwijenbergh Sep 6, 2023
ddc6851
Server: Have separate implementations for refreshing endpoints
jwijenbergh Sep 6, 2023
82a3c08
Client: Refresh server endpoints on renew and cleanup
jwijenbergh Sep 6, 2023
676c989
go.mod/go.sum: Run go mod tidy
jwijenbergh Sep 6, 2023
e8fd903
Exports: Format and rewrite some comments
jwijenbergh Sep 18, 2023
7a9ea88
Docs: Add autogenerated exports doc
jwijenbergh Sep 18, 2023
40eb1be
Docker + Workflows: Move to deploy repo
jwijenbergh Sep 18, 2023
9178c40
Export Docs: Update bullets spacing
jwijenbergh Sep 19, 2023
64b24b8
Genexportsdoc: Set executable flag
jwijenbergh Sep 19, 2023
848c165
Exports: Update docs
jwijenbergh Sep 21, 2023
d9a11b7
Exports: Update spacing in docs
jwijenbergh Sep 21, 2023
f079081
Docs API: Update state machine figure
jwijenbergh Sep 22, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,18 @@ jobs:
# Verify hash
echo "d276b0e594d5980de6a7917ce74c348f28d3cb8b353ca4eaae344ae8a4c40bea mdbook.tar.gz" | sha256sum --check

# Get mdbook-mermaid
curl -sSL https://github.com/badboy/mdbook-mermaid/releases/download/v0.12.6/mdbook-mermaid-v0.12.6-x86_64-unknown-linux-gnu.tar.gz -o mdbook-mermaid.tar.gz
# Verify hash
echo "04f9fa41f89b7a1809ef2525efc7ad2c112df4ae1241de25efe354940441ea70 mdbook-mermaid.tar.gz" | sha256sum --check

# Extract
mkdir mdbook
tar -xzf mdbook.tar.gz --directory mdbook
mkdir mdbook-mermaid
tar -xzf mdbook-mermaid.tar.gz --directory mdbook-mermaid
echo `pwd`/mdbook >> $GITHUB_PATH
echo `pwd`/mdbook-mermaid >> $GITHUB_PATH
- name: Install sphinx
run: |
# Install python dependencies
Expand Down Expand Up @@ -53,8 +61,13 @@ jobs:
cd wrappers/python/docs
make html

# Go to docs directory & build mdbook
cd ../../../docs
# Go to root
cd ../../..

# Install mermaid preprocessor
mdbook-mermaid install docs

cd docs
mdbook build

# gh pages branch settings
Expand All @@ -71,7 +84,7 @@ jobs:
mv ../book/* .

# move sphinx files
mkdir api/python/rtd
mkdir -p api/python/rtd
mv ../../wrappers/python/docs/build/html/* api/python/rtd

# Disable jekyll as otherwise it won't find our sphinx paths
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ jobs:
- uses: actions/checkout@v3
- name: Setup server
run: |
git clone https://github.com/eduvpn/documentation
cd documentation
git clone https://codeberg.org/eduvpn/deploy
cd deploy
sudo cp resources/[email protected] /etc/apt/trusted.gpg.d/[email protected]
echo "deb https://repo.eduvpn.org/v3/deb jammy main" | sudo tee /etc/apt/sources.list.d/eduVPN_v3.list
sudo apt-get -y update
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,9 @@
*.iml
.idea/
.DS_Store

# locales
/client/locales/*/out.gotext.json
/docs/book/
/cmd/cli/configs/
/ci/docker/selfsigned/
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ srpm:
rm -rf dist/*

# Archive code with vendored dependencies
git clone . dist/libeduvpn-common-1.1.2
git clone . dist/libeduvpn-common-2.0.0
go mod vendor
cp -r vendor dist/libeduvpn-common-1.1.2/vendor
cp -r vendor dist/libeduvpn-common-2.0.0/vendor
tar -zcvf ~/rpmbuild/SOURCES/libeduvpn-common.tar.gz -C dist .

# Cleanup
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ The only support language is Python at the moment. Other languages will come wit
The documentation for this library can be found at [GitHub pages](https://eduvpn.github.io/eduvpn-common).

## Contributing
Contributions are welcome.
Contributions are welcome. Helping with translations can be done on weblate:
<a href="https://hosted.weblate.org/engage/eduvpn-common/">
<img src="https://hosted.weblate.org/widget/eduvpn-common/eduvpn-common/multi-auto.svg" alt="Translation status" />
</a>

## License
[MIT](./LICENSE)
Expand Down
10 changes: 5 additions & 5 deletions ci/docker/eduvpnserver.docker
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
FROM fedora:36
FROM fedora:38

# This dockerfile was adapted from https://github.com/eduvpn/documentation/blob/v3/deploy_fedora.sh
# This dockerfile was adapted from https://codeberg.og/eduvpn/deploy/src/branch/v3/deploy_fedora.sh
# DO NOT USE THIS IN PRODUCTION, ONLY FOR TESTING

# Install git to clone the documentation repo
RUN dnf -y install git

WORKDIR /eduvpn

# Clone the documentation
RUN git clone https://github.com/eduvpn/documentation
# Clone the deploy
RUN git clone https://codeberg.org/eduvpn/deploy

WORKDIR /eduvpn/documentation
WORKDIR /eduvpn/deploy

# Checkout v3 branch
RUN git checkout v3
Expand Down
4 changes: 2 additions & 2 deletions ci/docker/gotest.docker
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ RUN apt-get -y install openjdk-11-jre xvfb python3-selenium firefox-esr python3-

# Install go from go.dev
# Get
RUN wget https://go.dev/dl/go1.19.4.linux-amd64.tar.gz -O go.tar.gz
RUN wget https://go.dev/dl/go1.21.0.linux-amd64.tar.gz -O go.tar.gz

# Verify hash
RUN echo "c9c08f783325c4cf840a94333159cc937f05f75d36a8b307951d5bd959cf2ab8 go.tar.gz" | sha256sum --check
RUN echo "d0398903a16ba2232b389fb31032ddf57cac34efda306a0eebac34f0965a0742 go.tar.gz" | sha256sum --check

# Untar
RUN tar -C /usr/local -xzf go.tar.gz
Expand Down
Loading