Skip to content

added sys.use_token, swaps between tokens and can revert to self with id 0 - #2396

Merged
hulto merged 1 commit into
spellshift:mainfrom
KS-7250:use-token
Sep 18, 2026
Merged

hulto merged 1 commit into
spellshift:mainfrom
KS-7250:use-token

Conversation

@KS-7250

@KS-7250 KS-7250 commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this?

/kind feature
/kind eldritch-function

What this PR does / why we need it:

We now have a global token store, but no way to swap between tokens in that store. sys.use_token() fixes that

  • sys.use_token(id: int) -> bool
$> sys.tokens()

| active | id | source               |
| ------ | -- | -------------------- |
| False  | 0  | process_token        |
| True   | 1  | impersonate:pid:6767 |

$> sys.shell('whoami')['stdout']
nt authority\system

$> sys.use_token(0)                   # revert to process token
True

$> sys.tokens()

| active | id | source               |
| ------ | -- | -------------------- |
| True   | 0  | process_token        |
| False  | 1  | impersonate:pid:6767 |

$> sys.shell('whoami')['stdout']
administrator

Which issue(s) this PR fixes:

Fixes N/A

…modified sys.tokens to show id 0 as default active
@hulto
hulto enabled auto-merge September 18, 2026 06:45
@hulto
hulto disabled auto-merge September 18, 2026 06:51
@hulto
hulto merged commit 03479b9 into spellshift:main Sep 18, 2026
9 of 10 checks passed
@KS-7250
KS-7250 deleted the use-token branch September 18, 2026 14:52
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

Successfully merging this pull request may close these issues.

2 participants