This repository has been archived by the owner on Aug 7, 2024. It is now read-only.
-
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.
feat: Add Rolebinding check support + change secret name format (#37)
* feat: update README + Changelog * feat(breaking): Add support for rolebinding checks * fix: bump go version
- Loading branch information
1 parent
ae0cbd1
commit 98cc2de
Showing
20 changed files
with
664 additions
and
106 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
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
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 |
---|---|---|
|
@@ -16,3 +16,6 @@ vendor/ | |
|
||
# Ignore test keys | ||
*.pem | ||
|
||
codeql | ||
codeql-go/ |
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,5 @@ | ||
# v0.1.0 | ||
|
||
## Breaking Changes | ||
- Support for rolebindings | ||
- Change secret format to use `-` instead of `_` |
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
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
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
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
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,34 @@ | ||
package client | ||
|
||
import ( | ||
"encoding/json" | ||
"fmt" | ||
"io/ioutil" | ||
"os" | ||
) | ||
|
||
func LoadToken(tokenPath *string) (*string, error) { | ||
jsonFile, err := os.Open(*tokenPath) | ||
if err != nil { | ||
return nil, err | ||
} | ||
defer jsonFile.Close() | ||
|
||
bytes, err := ioutil.ReadAll(jsonFile) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
var tokenMap map[string]string | ||
err = json.Unmarshal([]byte(bytes), &tokenMap) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
idToken, ok := tokenMap["id_token"] | ||
if !ok { | ||
return nil, fmt.Errorf("no 'id_token' field in token file") | ||
} | ||
|
||
return &idToken, nil | ||
} |
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.