-
Notifications
You must be signed in to change notification settings - Fork 13
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
Fixed session support #45
base: master
Are you sure you want to change the base?
Conversation
Bumps [ipython](https://github.com/ipython/ipython) from 7.18.1 to 8.10.0. - [Release notes](https://github.com/ipython/ipython/releases) - [Commits](ipython/ipython@7.18.1...8.10.0) --- updated-dependencies: - dependency-name: ipython dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]>
In order to support proxies, shared session tokesn, and other authorization schemes, this commit supports supplying either username/password as before OR a session_token argument/config key.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! A couple of small suggestions (one of which I may be wrong about), mostly in the documentation.
|
||
An example .archivessnake.yml file: | ||
An minimal example of an .archivessnake.yml file: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is very minor, but "an" should be changed to "a."
| `retry_with_auth` | Whether to respond to 403 errors by trying to authorize and retrying | True | | ||
| `logging_config` | Hash with various config values for the logging subsystem | **see below** | | ||
|
||
`username`/`password` and `session_token` are mutually exclusive. In a normally configured ArchivesSpace system, you will want to use `username`/`password`. `session_token` allows you to set a fixed value for the session, in case you are sharing a long-lived session amongst several apps, or using an authorization customization that bypasses the ArchivesSpace login route. Examples of this include proxies or SSO plugins. `session_header_name` lets you customize the header you pass the session in, since some proxies use a different header than `X-ArchivesSpace-Session`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be worth being more explicit that a config file can't have a username and a session token. A user may expect behavior such as one being used by default, or being able to choose the authorization method while running ArchivesSnake. I don't think either are necessary, but it might make sense to be explicit here.
log.debug('argument error in authorize') | ||
raise ASnakeAuthError("Cannot set both username/password and session_token") | ||
|
||
session_header_name = session_header_name or self.config['session_header_name'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be self.config.get('session_header_name', None)
?
This PR updates ASnake to support directly providing a session token in configuration or as an argument to the client/abstraction layer constructors. This is intended to provide support for the following use cases