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

Feature: Ipython console #2

Open
erinn opened this issue Dec 11, 2017 · 2 comments
Open

Feature: Ipython console #2

erinn opened this issue Dec 11, 2017 · 2 comments

Comments

@erinn
Copy link

erinn commented Dec 11, 2017

I don't know how easy or reasonable this request would be, and maybe at some point I can look into doing it myself, but would it be possible to have ipython for the interactive session? Gives command completion, history and all kinds of other goodness.

Thanks for the project, will be using it extensively soon.

@DirectXMan12
Copy link
Member

I'm not an IPython user, and probably won't have time to add support myself, but I'd accept a PR that keeps things well-separated. FWIW, the current gssapi-console does have completion and history support, but I do get the appeal of IPython.

The internals of gssapi-console are actually relatively simple -- most of the hard work is done by k5test and Python's built-in REPL library (code.InteractiveConsole).

Basically, gssapi-console does the following (not including the yalpt driver):

  1. accept a "driver" (currently only the krb5 driver exists)
  2. ask the driver to set up a realm if one wasn't passed in (calls out to k5test)
  3. "attach" to the realm (calls out to k5test)
  4. setup up the REALM local to point to the realm configuration object
  5. print a useful banner
  6. import gssapi and gssapi.raw as gb
  7. launch into the main REPL (just calls out to code.InteractiveConsole currently)

You can look at core.py and drivers.py for more details

@erinn
Copy link
Author

erinn commented Dec 20, 2017

As a very, very quick and dirty way, run gssapi-console, then the following:

from IPython import embed
embed()

Anyway continuing to look at how to put this together.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants