mirror of
https://github.com/rjNemo/rentease.git
synced 2026-06-06 02:36:49 +00:00
nosec
This commit is contained in:
parent
26c8996f0f
commit
3c31b142f6
1 changed files with 3 additions and 0 deletions
|
|
@ -114,7 +114,9 @@ func getTokenFromWeb(config *oauth2.Config) *oauth2.Token {
|
|||
}
|
||||
|
||||
// Retrieves a token from a local file.
|
||||
// #nosec G304
|
||||
func tokenFromFile(file string) (*oauth2.Token, error) { //nolint:unused
|
||||
|
||||
f, err := os.Open(file)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
@ -134,6 +136,7 @@ func tokenFromEnv() (*oauth2.Token, error) {
|
|||
}
|
||||
|
||||
// Saves a token to a file path.
|
||||
// #nosec G304
|
||||
func saveToken(path string, token *oauth2.Token) {
|
||||
log.Printf("Saving credential file to: %s\n", path)
|
||||
f, err := os.OpenFile(path, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0600)
|
||||
|
|
|
|||
Loading…
Reference in a new issue