8f0b9b181e4b7be813445c43693a3f666e8b7619 lrnassar Fri Oct 10 18:57:15 2025 -0700 Adding API key documentation and updating the CAPTCHA message so people can find it, refs #36428 diff --git src/hg/hgHubConnect/hgHubConnect.c src/hg/hgHubConnect/hgHubConnect.c index a9fae7b6897..35a4fc6ebee 100644 --- src/hg/hgHubConnect/hgHubConnect.c +++ src/hg/hgHubConnect/hgHubConnect.c @@ -422,60 +422,60 @@ static char *getApiKey(char *userName) /* Grab the already created api key if it exists */ { char *tableName = cfgOptionDefault("authTableName", AUTH_TABLE_DEFAULT); struct sqlConnection *conn = hConnectCentral(); struct dyString *query = sqlDyStringCreate("select apiKey from %s where userName='%s'", tableName, userName); char *apiKey = sqlQuickString(conn, dyStringCannibalize(&query)); hDisconnectCentral(&conn); return apiKey; } void printApiKeySection() { puts("
"); -puts("

Hubtools API key

"); +puts("

API key

"); char *userName = wikiLinkUserName(); char *userId = wikiLinkUserId(); if (userName==NULL || userId==NULL) { char *hgsid = cartSessionId(cart); char *loginUrl = wikiLinkUserLoginUrlReturning(hgsid, wikiLinkEncodeReturnUrl(hgsid, "hgHubConnect", "#dev")); printf("
You are not logged in. Please Login now, then this page will show the API key.
", loginUrl); } else { char *existingKey = getApiKey(userName); if (existingKey) { - puts("
You have already generated an api key for use in hubtools. If you would like to generate a new key (which automatically revokes old keys), please click 'generate key'. Otherwise, you can copy and paste the below key to your ~/.hubtools.conf file:

"); + puts("
You have already generated an API key. If you would like to generate a new key (which revokes old keys), click 'Generate key'. To use your API key with Hubtools, copy and paste the below key to your ~/.hubtools.conf file. This is not necessary for URL use to bypass our CAPTCHA.

"); puts("
"); printf("%s\n", existingKey); puts("
"); puts("
"); - puts("
Generate an api key
"); + puts("
Generate an API key
"); } else { puts("
To use the hubtools up command, click 'generate key'"); puts("
"); printf("
Now, create a file ~/.hubtools.conf and add the key:
\n", existingKey != NULL ? "block" : "none"); puts("
"); puts("
"); } - printf("
\nTo revoke any apiKeys associated with your account, click the revoke button: \n
", existingKey != NULL ? "block" : "none"); + printf("
\nTo revoke any API keys associated with your account, click the revoke button: \n
", existingKey != NULL ? "block" : "none"); // add the event handlers for clicking the generate/revoke buttons jsInlineF("" "document.getElementById('generateApiKey').addEventListener('click', generateApiKey);\n" "document.getElementById('revokeApiKeys').addEventListener('click', revokeApiKeys);\n" ); } puts("
"); // tabSection apiKey } void hgHubConnectDeveloperMode() /* Put up the controls for the "Hub Development" Tab, which includes a button to run the * hubCheck utility on a hub and load a hub with the udcTimeout and measureTiming * variables turned on */ {