-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adding initial login for github with proper session handling * Fixing logging to be clearer * Adding initial sync for manager, updating schema for github flow to include a next url * Moving session manager into its own package * Adding registration with async cache * Adding test case for session * Updating storage interface order * Updating v1Options to allow for next URL to be programmable * Updating API to shut down manager and authentication providers * Updating API to shut down manager and authentication providers * Making it safe to shutdown the database even it if was started in an error * Fixing panic * Updating auth login endpoints to all be get requests * Updating swagger for new github callback changes * Adding logging to manager * Theoretically working device code flow * Fixing API so that it shuts down the Device provider * Updating manager to create secret key and registration key if it does not already exist * Updating manager because storage for registration will never return key not found error * Adding better errors to manager * Adding better errors to manager * Updating device flow API to properly return errors for the polling rate * Fixing deadlock in manager * Fixing bug in device flow where lowercase strings could be returned * Fixing bug in device flow where lowercase strings could be returned * Adding better logging * Adding logging for better debuggability * Fixing bug where logger wasn't being propagated to db * Adding better logging * Making sure aes encryption returns a base64 encoded string and requires ones back * Making sure aes encryption returns a base64 encoded string and requires ones back * Moving ent package to internal folder * Adding test case runner * Making sure tls propagates in manager cookie setter * starting to add api key and service key functionality * Hooking up api key provider * Cleaning up api key interfaces * Adding api key validation code (#1) * Adding Service Key Interface (#2) * Fixing old api key code (removed option) * Adding service key login * Adding logged in and logout routes * Adding logged in and logout routes * Updating comments regarding service key session handling * Updating generated code
- Loading branch information
1 parent
cd5968a
commit 704c144
Showing
116 changed files
with
11,330 additions
and
14,444 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Test | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- "*" | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: "1.19" | ||
check-latest: true | ||
cache: true | ||
|
||
- name: Test | ||
run: go test -v ./... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
Copyright 2023 Loophole Labs | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package auth | ||
|
||
const ( | ||
APIKeyPrefixString = "AK-" | ||
ServiceKeyPrefixString = "SK-" | ||
ServiceKeySessionPrefixString = "SS-" | ||
) | ||
|
||
var ( | ||
APIKeyPrefix = []byte(APIKeyPrefixString) | ||
ServiceKeySessionPrefix = []byte(ServiceKeySessionPrefixString) | ||
) | ||
|
||
const ( | ||
SessionContextKey = "session" | ||
APIKeyContextKey = "apikey" | ||
ServiceKeySessionContextKey = "service" | ||
UserContextKey = "user" | ||
OrganizationContextKey = "organization" | ||
) | ||
|
||
type Kind string | ||
|
||
const ( | ||
KindContextKey Kind = "kind" | ||
|
||
KindSession Kind = "session" | ||
KindAPIKey Kind = "api" | ||
KindServiceKey Kind = "service" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.