StackStorm / st2docs

StackStorm Documentation.
https://docs.stackstorm.com/
64 stars 170 forks source link

Fix option name for ldap groups TTL #1154

Closed litew closed 1 year ago

litew commented 1 year ago

Actual option name cache_user_groups_cache_ttl differs from option mentioned in docs.

https://github.com/StackStorm/st2-auth-ldap/blob/80779a353092a7e3f167770b2c912812ecb94d5c/st2auth_ldap/ldap_backend.py#L70

Traceback (most recent call last):
  File "/opt/stackstorm/st2/lib/python3.8/site-packages/st2auth/cmd/api.py", line 111, in main
    return _run_server()
  File "/opt/stackstorm/st2/lib/python3.8/site-packages/st2auth/cmd/api.py", line 100, in _run_server
    wsgi.server(socket, app.setup_app(), log=LOG, log_output=False)
  File "/opt/stackstorm/st2/lib/python3.8/site-packages/st2auth/app.py", line 80, in setup_app
    router.add_spec(spec, transforms=transforms)
  File "/opt/stackstorm/st2/lib/python3.8/site-packages/st2common/router.py", line 262, in add_spec
    __import__(module_name)
  File "/opt/stackstorm/st2/lib/python3.8/site-packages/st2auth/controllers/v1/auth.py", line 92, in <module>
    token_controller = TokenController()
  File "/opt/stackstorm/st2/lib/python3.8/site-packages/st2auth/controllers/v1/auth.py", line 61, in __init__
    self.handler = HANDLER_MAPPINGS[cfg.CONF.auth.mode]()
  File "/opt/stackstorm/st2/lib/python3.8/site-packages/st2auth/handlers.py", line 150, in __init__
    self._auth_backend = get_auth_backend_instance(name=cfg.CONF.auth.backend)
  File "/opt/stackstorm/st2/lib/python3.8/site-packages/st2auth/backends/__init__.py", line 63, in get_backend_instance
    raise exc_cls(msg)
TypeError: Failed to instantiate auth backend "ldap" (class LDAPAuthenticationBackend) with backend settings "{'bind_dn': 'uid=st2ipa,cn=users,cn=accounts,dc=test,dc=ipa', 'bind_password': 'password', 'base_ou': 'cn=users,cn=accounts,dc=test,dc=ipa', 'base_ou_group': 'cn=groups,cn=accounts,dc=test,dc=ipa', 'group_dns': ['cn=stackstorm-users,cn=groups,cn=accounts,dc=test,dc=ipa'], 'group_pattern': '(&(objectClass=posixGroup)(member={user_dn}))', 'host': 'ipa01.test.ipa', 'port': '389', 'debug': 'True', 'cache_user_groups_response': 'True', 'cache_user_groups_ttl': '5'}": __init__() got an unexpected keyword argument 'cache_user_groups_ttl'

Traceback (most recent call last):
  File "/opt/stackstorm/st2/lib/python3.8/site-packages/st2auth/backends/__init__.py", line 53, in get_backend_instance
    cls_instance = cls(**kwargs)
TypeError: __init__() got an unexpected keyword argument 'cache_user_groups_ttl'

Fix this by renaming option cache_user_groups_ttl to cache_user_groups_cache_ttl in docs.

CLAassistant commented 1 year ago

CLA assistant check
All committers have signed the CLA.

cognifloyd commented 1 year ago

Please sign the CLA (click the button) and fix the whitespace issue noted here: https://app.circleci.com/pipelines/github/StackStorm/st2docs/669/workflows/fb1a3524-45f8-497d-b0b1-b472995d36f3/jobs/3405/parallel-runs/0/steps/0-108

litew commented 1 year ago

Please sign the CLA (click the button) and fix the whitespace issue noted here: https://app.circleci.com/pipelines/github/StackStorm/st2docs/669/workflows/fb1a3524-45f8-497d-b0b1-b472995d36f3/jobs/3405/parallel-runs/0/steps/0-108

done

cognifloyd commented 1 year ago

Thanks for the fix!