Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jared/api key to access token #1733

Merged
merged 12 commits into from
Jul 9, 2024
Merged

Jared/api key to access token #1733

merged 12 commits into from
Jul 9, 2024

Conversation

jared-2016
Copy link
Collaborator

Description

update apikey terminology to use access token instead. Also renamed samples when being run standalone to not have - C++ included in it's name.

Also caught a few main signatures that deviated from the rest. Updated them so it's unified.

since i modified main.cpp files of individual samples, I picked 1/2 from each category and built them standalone and ran into no issues. Testing all 220 I think is unnecessary as the changes are all the same.

Type of change

  • Bug fix
  • New sample implementation
  • Sample viewer enhancement
  • Other enhancement

Platforms tested on:

  • Windows
  • Android
  • Linux
  • macOS
  • iOS

Checklist

  • Runs and compiles on all active platforms as a standalone sample
  • Runs and compiles in the sample viewer(s)
  • Branch is up to date with the latest main/v.next
  • All merge conflicts have been resolved
  • Self-review of changes
  • There are no warnings related to changes
  • No unrelated changes have been made to any other code or project files
  • Code is commented with correct formatting (CTRL+i)
  • All variable and method names are camel case
  • There is no leftover commented code
  • Screenshots are correct size and display in description tab (500px by 500px, platform agnostic)
  • If adding a new sample, it is added to the sample viewer
  • Cherry-picked to Main branch (if applicable)

@jared-2016 jared-2016 self-assigned this Jul 9, 2024
@jared-2016
Copy link
Collaborator Author

The templates have not been included in this PR as of right now.

The templates use a helper function to set the apikey(access token) but it also checks the command line to see if it was passed in that way. If this is something we wish to keep. It will require some reformatting from what the original issue requested it to be changed too. It's doable to find and replace it and put the forward declare and function implementation back. Seems like a luxury that I don't find most people doing.

for reference:

void setAPIKey(const QGuiApplication& app, QString apiKey)
{
if (apiKey.isEmpty())
{
// Try parsing API key from command line argument, which uses the following syntax "-k <apiKey>".
QCommandLineParser cmdParser;
QCommandLineOption apiKeyArgument(QStringList{"k", "api"}, "The API Key property used to access Esri location services", "apiKeyInput");
cmdParser.addOption(apiKeyArgument);
cmdParser.process(app);
apiKey = cmdParser.value(apiKeyArgument);
if (apiKey.isEmpty())
{
qWarning() << "Use of Esri location services, including basemaps, requires" <<
"you to authenticate with an ArcGIS identity or set the API Key property.";
return;
}
}
Esri::ArcGISRuntime::ArcGISRuntimeEnvironment::setApiKey(apiKey);
}

@jared-2016
Copy link
Collaborator Author

jared-2016 commented Jul 9, 2024

Also it's worth mentioning that it was never rolled out to all samples( I think I ran into about 30 or so). We just updated the template at some point and started using it from there. If this is something we should decide to keep, we should update the samples to use this so the experience is consistent.

@JamesMBallard
Copy link
Contributor

I agree with your assessment to just remove the command-line method of setting the API key. It was only there for a subset of samples, so we should make it official and consistent in the future if we want it. Good call.

Copy link
Contributor

@JamesMBallard JamesMBallard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did a spot check. Looks good.

@jared-2016
Copy link
Collaborator Author

jared-2016 commented Jul 9, 2024

I updated templates which made me realize I forgot Widgets 😮, that's been resolved and it's just more of the same.

Copy link
Contributor

@ldanzinger ldanzinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jared-2016 jared-2016 merged commit fe4593b into v.next Jul 9, 2024
@jared-2016 jared-2016 deleted the jared/ApiKeyToAccessToken branch July 9, 2024 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants