Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Memri
plugins
flickr
Commits
a43640ca
Commit
a43640ca
authored
1 year ago
by
Alp Deniz Ogut
Browse files
Options
Download
Email Patches
Plain Diff
Use callback_url from env. set default to demo page
parent
66948f30
Pipeline
#14833
passed with stages
in 1 minute and 5 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
flickr_plugin/config.py
+4
-1
flickr_plugin/config.py
flickr_plugin/plugin.py
+2
-2
flickr_plugin/plugin.py
with
6 additions
and
3 deletions
+6
-3
flickr_plugin/config.py
+
4
-
1
View file @
a43640ca
...
...
@@ -5,4 +5,7 @@ load_dotenv()
SERVICE_NAME
=
"flickr"
API_KEY
=
os
.
getenv
(
"FLICKR_API_KEY"
)
SECRET_KEY
=
os
.
getenv
(
"FLICKR_API_SECRET"
)
\ No newline at end of file
SECRET_KEY
=
os
.
getenv
(
"FLICKR_API_SECRET"
)
# OAuth callback url
CALLBACK_URL
=
os
.
environ
.
get
(
"CALLBACK_URL"
,
'https://d37rcpzq1f4qlq.cloudfront.net'
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
flickr_plugin/plugin.py
+
2
-
2
View file @
a43640ca
...
...
@@ -19,7 +19,7 @@ from .data.schema import (
)
from
time
import
time
,
sleep
from
.service.flickr_api
import
FlickrService
from
.config
import
SERVICE_NAME
from
.config
import
SERVICE_NAME
,
CALLBACK_URL
from
flickrapi.auth
import
FlickrAccessToken
from
concurrent.futures
import
ThreadPoolExecutor
from
urllib.parse
import
parse_qs
...
...
@@ -92,7 +92,7 @@ class FlickrPlugin(PluginBase):
def
auth
(
self
):
oauth_flow
=
self
.
get_authentication_flow
()
if
not
oauth_flow
or
not
oauth_flow
.
accessToken
or
oauth_flow
.
status
==
'fail'
:
url
=
self
.
flickr_service
.
get_oauth_url
(
'http://localhost:1234'
)
url
=
self
.
flickr_service
.
get_oauth_url
(
CALLBACK_URL
)
oauth_flow
.
authUrl
=
url
oauth_flow
.
status
=
'await_user_action'
self
.
client
.
update_item
(
oauth_flow
)
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets