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

MGP auth has no method check_token_expiration #17

Open
NBStephens opened this issue Mar 5, 2024 · 0 comments
Open

MGP auth has no method check_token_expiration #17

NBStephens opened this issue Mar 5, 2024 · 0 comments

Comments

@NBStephens
Copy link

Version

mgp-sdk version 1.3.2

Problem

When working through the raster analytics notebooks I consistently received an error when various methods attempted to check for the authorization token freshness. Although I may be missing something, the Auth class from /MGP_SDK/auth/auth.py doesn't appear to have a check_token_expiration method.

Ultimately, I know they are just strings but I have tried with the old OAuth2 bearer token and the newer API key method here: https://github.com/Maxar-Corp/maxar-geospatial-platform/

Hack

Hashing out the following lines allows for the demonstrated methods to mostly function properly:

/MGP_SDK/analytics_service/analytics.py:48
/MGP_SDK/analytics_service/analytics.py:106
/MGP_SDK/analytics_service/analytics.py:133
/MGP_SDK/analytics_service/analytics.py:152

Error

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[9], line 1
----> 1 raster_url = raster.raster_url(script_id=script_id, 
      2                                function=function, 
      3                                collect_id=collect_id, 
      4                                api_token=api_token, 
      5                                crs=crs, 
      6                                bands=bands, 
      7                                dra=dra)
      8 print(raster_url)
...
     27 def create_raster_url(self, script_id, function, collect_id, api_token, crs='UTM', **kwargs):
     28     """
     29     Formats a vsicurl URL to be utilized with further raster functions
     30     Args:
   (...)
     46         URL formatted with desired parameters and /vsicurl/ prefix
     47     """
---> 48     self.auth.check_token_expiration()
     49     if script_id.lower() == 'browse':
     50         if function != "browse":

AttributeError: 'Auth' object has no attribute 'check_token_expiration'
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

No branches or pull requests

1 participant