MCPcopy Create free account
hub / github.com/crashappsec/github-analyzer / parseOauthApps

Function parseOauthApps

pkg/output/html/html.go:120–140  ·  view source on GitHub ↗
(appJson string)

Source from the content-addressed store, hash-verified

118}
119
120func parseOauthApps(appJson string) ([]WrappedOAuthApp, error) {
121 var apps []scrape.OAuthApp
122
123 jsonFile, err := os.Open(appJson)
124 defer jsonFile.Close()
125 if err != nil {
126 return nil, err
127 }
128 jsonBytes, err := ioutil.ReadAll(jsonFile)
129 if err != nil {
130 return nil, err
131 }
132 json.Unmarshal(jsonBytes, &apps)
133
134 var wrappedApps []WrappedOAuthApp
135 for _, app := range apps {
136 wrappedApps = append(wrappedApps,
137 WrappedOAuthApp{App: app, State: getOauthAppState(int(app.State))})
138 }
139 return wrappedApps, nil
140}
141
142func parsePermissions(
143 permJson string,

Callers 1

ServeFunction · 0.85

Calls 1

getOauthAppStateFunction · 0.85

Tested by

no test coverage detected