bitshares / bitshares/bitshares-core

`login_api::logout` API does not clean up registered API sets

Open
#2,618 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
1.2k
Forks
660
Avg merge
8h 17m
Merged PRs (30d)
26

Description

**Bug Description**

When `login_api::logout` is called, or `login_api::login` is called again but failed, or succeeded but the new user has access to fewer API sets, ideally, we should clean up the API sets that the previous user registered but is no longer available.

However, the shared pointers to these objects are already saved elsewhere (in FC), so we are unable to clean up.

That means the API set IDs for the registered API sets are still accessible even if the new user should not have access to.

https://github.com/bitshares/bitshares-core/blob/8c93d58d38db8debd8c39467169fa01ea147e1d3/libraries/app/api.cpp#L80-L83

https://github.com/bitshares/bitshares-core/blob/8c93d58d38db8debd8c39467169fa01ea147e1d3/libraries/app/api.cpp#L91-L93

**Impacts**
Describe which portion(s) of BitShares Core may be impacted by this bug. Please tick at least one box.
- [x] API (the application programming interface)
- [ ] Build (the build process or something prior to compiled code)
- [ ] CLI (the command line wallet)
- [ ] Deployment (the deployment process after building such as Docker, Travis, etc.)
- [ ] DEX (the Decentralized EXchange, market engine, etc.)
- [ ] P2P (the peer-to-peer network for transaction/block propagation)
- [ ] Performance (system or user efficiency, etc.)
- [ ] Protocol (the blockchain logic, consensus, validation, etc.)
- [ ] Security (the security of system or user data, etc.)
- [ ] UX (the User Experience)
- [ ] Other (please add below)

**Host Environment**
Please provide details about the host environment. Much of this information can be found running: `witness_node --version`.
- Host OS: [e.g. Ubuntu 18.04 LTS]
- Host Physical RAM [e.g. 4GB]
- BitShares Version: [e.g. 2.0.180425]
- OpenSSL Version: [e.g. 1.1.0g]
- Boost Version: [e.g. 1.65.1]

## CORE TEAM TASK LIST
- [ ] Evaluate / Prioritize Bug Report
- [ ] Refine User Stories / Requirements
- [ ] Define Test Cases
- [ ] Design / Develop Solution
- [ ] Perform QA/Testing
- [ ] Update Documentation

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in libraries/app/api.cpp at the referenced login and logout code, then trace where the registered API sets are retained by shared pointers in FC. Confirm the behavior across logout and login with reduced API-set access. Done means API-set IDs from the previous user are no longer accessible after those transitions.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.