Skip to content

Commit

Permalink
Add CI for spell (#275)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkroepke authored May 31, 2024
1 parent 0867c85 commit edf661d
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 10 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/spelling.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Spell checking

# Trigger on pull requests, and pushes to master branch.
on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
codespell:
name: Check for spelling errors
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: codespell-project/actions-codespell@406322ec52dd7b488e48c1c4b82e2a8b3a1bf630
with:
check_filenames: true
# When using this Action in other repos, the --skip option below can be removed
skip: ./.git,./CODE_OF_CONDUCT.md,go.mod,go.sum,go.work,go.work.sum,./internal/ui/assets/i18n
10 changes: 5 additions & 5 deletions docs/Home.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@ sequenceDiagram
Browser->>+openvpn-auth-oauth2: connect https://openvpn.example.com
openvpn-auth-oauth2->>+OAuth2 Provider: redirects
actor User
Note over OAuth2 Provider,User: User enter credentuals
OAuth2 Provider-->>-openvpn-auth-oauth2: Login Successfull
Note over OAuth2 Provider,User: User enter credentials
OAuth2 Provider-->>-openvpn-auth-oauth2: Login Successful
Note over openvpn-auth-oauth2: Store refresh token, if provided
openvpn-auth-oauth2-->>-Browser: Login Successfull
openvpn-auth-oauth2-->>-Browser: Login Successful
openvpn-auth-oauth2->>OpenVPN Server: client-auth
Note over OpenVPN Client,OpenVPN Server: connection etablished
Note over OpenVPN Client,OpenVPN Server: connection established
OpenVPN Client->>+OpenVPN Server: Session refresh (reneg-sec)
OpenVPN Server->>+openvpn-auth-oauth2: ">CLIENT:REAUTH"
alt has refresh token
openvpn-auth-oauth2->>+OAuth2 Provider: "Non-interactive login via refresh token"
OAuth2 Provider-->>-openvpn-auth-oauth2: Login Successfull
OAuth2 Provider-->>-openvpn-auth-oauth2: Login Successful
else has no refresh token
Note over openvpn-auth-oauth2,OAuth2 Provider: Traditional login, see above
end
Expand Down
4 changes: 2 additions & 2 deletions docs/Providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ CONFIG_OAUTH2_CLIENT_SECRET=$CLIENT_SECRET

### Restrict auth to specific groups in your directory. (optional)

Restrict login based on groups can be configured inside the App Registration directly. This is generally prefered, since users get the notice from Azure that they are not part of the group and the login would be denied.
Restrict login based on groups can be configured inside the App Registration directly. This is generally preferred, since users get the notice from Azure that they are not part of the group and the login would be denied.

Referece: https://learn.microsoft.com/en-us/entra/identity-platform/howto-restrict-your-app-to-a-set-of-users#assign-the-app-to-users-and-groups-to-restrict-access
Reference: https://learn.microsoft.com/en-us/entra/identity-platform/howto-restrict-your-app-to-a-set-of-users#assign-the-app-to-users-and-groups-to-restrict-access

How require multiple groups, check you could define `CONFIG_OAUTH2_VALIDATE_GROUPS`.

Expand Down
4 changes: 2 additions & 2 deletions internal/openvpn/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ func (c *Client) Shutdown() {
}

// SendCommand passes command to a given connection (adds logging and EOL character) and returns the response.
func (c *Client) SendCommand(cmd string, passTrough bool) (string, error) {
func (c *Client) SendCommand(cmd string, passthrough bool) (string, error) {
if c.closed.Load() == 1 {
return "", nil
}
Expand All @@ -189,7 +189,7 @@ func (c *Client) SendCommand(cmd string, passTrough bool) (string, error) {
case <-c.ctx.Done():
return "", ErrConnectionTerminated // Error somewhere, terminate
case resp := <-c.commandResponseCh:
if passTrough {
if passthrough {
return resp, nil
}

Expand Down
2 changes: 1 addition & 1 deletion internal/state/state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func TestState_WithSpace(t *testing.T) {

encryptionKey := testutils.Secret

token := state.New(state.ClientIdentifier{CID: 1, KID: 2}, "127.0.0.1", "12345", "te st")
token := state.New(state.ClientIdentifier{CID: 1, KID: 2}, "127.0.0.1", "12345", "t e s t")

encodedTokenString, err := token.Encode(encryptionKey)

Expand Down

0 comments on commit edf661d

Please sign in to comment.