Update ESI SSO client ID and expand permission scopes for enhanced functionality
This commit is contained in:
43
app.go
43
app.go
@@ -28,7 +28,7 @@ func (a *App) startup(ctx context.Context) {
|
|||||||
|
|
||||||
clientID := os.Getenv("EVE_SSO_CLIENT_ID")
|
clientID := os.Getenv("EVE_SSO_CLIENT_ID")
|
||||||
if clientID == "" {
|
if clientID == "" {
|
||||||
clientID = "5091f74037374697938384bdbac2698c"
|
clientID = "77c5adb91e46459b874204ceeedb459f"
|
||||||
}
|
}
|
||||||
redirectURI := os.Getenv("EVE_SSO_REDIRECT_URI")
|
redirectURI := os.Getenv("EVE_SSO_REDIRECT_URI")
|
||||||
if redirectURI == "" {
|
if redirectURI == "" {
|
||||||
@@ -36,7 +36,46 @@ func (a *App) startup(ctx context.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add location read scope so we can fetch character locations
|
// Add location read scope so we can fetch character locations
|
||||||
a.ssi = NewESISSO(clientID, redirectURI, []string{"esi-ui.write_waypoint.v1", "esi-location.read_location.v1"})
|
a.ssi = NewESISSO(clientID, redirectURI, []string{
|
||||||
|
"esi-location.read_location.v1",
|
||||||
|
"esi-location.read_ship_type.v1",
|
||||||
|
"esi-mail.organize_mail.v1",
|
||||||
|
"esi-mail.read_mail.v1",
|
||||||
|
"esi-mail.send_mail.v1",
|
||||||
|
"esi-skills.read_skills.v1",
|
||||||
|
"esi-skills.read_skillqueue.v1",
|
||||||
|
"esi-wallet.read_character_wallet.v1",
|
||||||
|
"esi-wallet.read_corporation_wallet.v1",
|
||||||
|
"esi-characters.read_contacts.v1",
|
||||||
|
"esi-killmails.read_killmails.v1",
|
||||||
|
"esi-assets.read_assets.v1",
|
||||||
|
"esi-planets.manage_planets.v1",
|
||||||
|
"esi-ui.write_waypoint.v1",
|
||||||
|
"esi-characters.write_contacts.v1",
|
||||||
|
"esi-markets.structure_markets.v1",
|
||||||
|
"esi-characters.read_loyalty.v1",
|
||||||
|
"esi-characters.read_chat_channels.v1",
|
||||||
|
"esi-characters.read_medals.v1",
|
||||||
|
"esi-characters.read_standings.v1",
|
||||||
|
"esi-characters.read_agents_research.v1",
|
||||||
|
"esi-industry.read_character_jobs.v1",
|
||||||
|
"esi-markets.read_character_orders.v1",
|
||||||
|
"esi-characters.read_blueprints.v1",
|
||||||
|
"esi-characters.read_corporation_roles.v1",
|
||||||
|
"esi-location.read_online.v1",
|
||||||
|
"esi-characters.read_fatigue.v1",
|
||||||
|
"esi-killmails.read_corporation_killmails.v1",
|
||||||
|
"esi-wallet.read_corporation_wallets.v1",
|
||||||
|
"esi-characters.read_notifications.v1",
|
||||||
|
"esi-assets.read_corporation_assets.v1",
|
||||||
|
"esi-industry.read_corporation_jobs.v1",
|
||||||
|
"esi-markets.read_corporation_orders.v1",
|
||||||
|
"esi-industry.read_character_mining.v1",
|
||||||
|
"esi-industry.read_corporation_mining.v1",
|
||||||
|
"esi-planets.read_customs_offices.v1",
|
||||||
|
"esi-characters.read_titles.v1",
|
||||||
|
"esi-characters.read_fw_stats.v1",
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// Greet returns a greeting for the given name
|
// Greet returns a greeting for the given name
|
||||||
|
@@ -46,7 +46,6 @@ type ESISSO struct {
|
|||||||
characterID int64
|
characterID int64
|
||||||
characterName string
|
characterName string
|
||||||
|
|
||||||
callbackOnce sync.Once
|
|
||||||
server *http.Server
|
server *http.Server
|
||||||
|
|
||||||
db *gorm.DB
|
db *gorm.DB
|
||||||
@@ -514,7 +513,6 @@ func (s *ESISSO) postWaypointWithToken(tok string, destinationID int64, clearOth
|
|||||||
q.Set("datasource", "tranquility")
|
q.Set("datasource", "tranquility")
|
||||||
endpoint := esiBase + "/v2/ui/autopilot/waypoint?" + q.Encode()
|
endpoint := esiBase + "/v2/ui/autopilot/waypoint?" + q.Encode()
|
||||||
|
|
||||||
fmt.Printf("ESI: POST waypoint dest=%d clear=%v addToBeginning=%v\n", destinationID, clearOthers, addToBeginning)
|
|
||||||
req, err := http.NewRequest(http.MethodPost, endpoint, nil)
|
req, err := http.NewRequest(http.MethodPost, endpoint, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -529,11 +527,9 @@ func (s *ESISSO) postWaypointWithToken(tok string, destinationID int64, clearOth
|
|||||||
}
|
}
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
if resp.StatusCode == http.StatusNoContent || resp.StatusCode == http.StatusOK {
|
if resp.StatusCode == http.StatusNoContent || resp.StatusCode == http.StatusOK {
|
||||||
fmt.Println("ESI: waypoint set OK", resp.Status)
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
b, _ := io.ReadAll(resp.Body)
|
b, _ := io.ReadAll(resp.Body)
|
||||||
fmt.Printf("ESI: waypoint failed %s body=%s\n", resp.Status, string(b))
|
|
||||||
return fmt.Errorf("waypoint failed: %s: %s", resp.Status, string(b))
|
return fmt.Errorf("waypoint failed: %s: %s", resp.Status, string(b))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user