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

Eliminate context['engine']['service'] #291

Open
hasegaw opened this issue Jun 2, 2016 · 0 comments
Open

Eliminate context['engine']['service'] #291

hasegaw opened this issue Jun 2, 2016 · 0 comments

Comments

@hasegaw
Copy link
Owner

hasegaw commented Jun 2, 2016

context['engine']['service']['function_name'] has been provided for a while, but it should be eliminated.

Background

Originally I wanted to restrict access to the engine object from plugins, because the engine has several references to the important data (e.g. users' twitter/stat.ink/slack authentication ID) that should not to be exposed to unverified plugins.

However recently I realized current design doesn't work as expected, because bound method such as context['engine']['service']['function_name'] allows access to IkaEngine object, because of Python language design.

dhcp44-80:IkaLog_github14 hasegaw$ python3
>>> class hoge():
...     def a(self):
...         print('hello')
...
>>>
>>> a = hoge().a
>>> a
<bound method hoge.a of <__main__.hoge object at 0x10f5c5c50>>
>>> a.__self__
<__main__.hoge object at 0x10f5c5c50>

Therefore context['engine']['service'] is not a good, redundant approach that should be altered by ref to the engine (introduced in commit c584828) , and should be removed.

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