spinframework / spinframework/spin

Read access to (some) spin.toml's value from components(applications)

Open
#1,738 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
6.5k
Forks
310
Avg merge
1d 20h
Merged PRs (30d)
24

Description

To read a file from my (sub)component in a Rust project,
I need to specify its path starting from the very beginning of the project. (not component but from spin root project)

let reader = maxminddb::Reader::open_readfile(
       "geoip/geodb/GeoLite2-City.mmdb"
    ).unwrap();

If I can read its working directory from spin.toml (component.build.workdir), I can make its file path more neutral with respect to the component's name (i.e., "{component.build.workdir}/geodb/GeoLite2-City.mmdb").

Additionally, allowing the application to read 'id,' 'workdir,' 'files,' 'allowed_http_hosts,' and 'route' from spin's component section would provide more flexibility and creativity for spin users.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is named. Start by tracing how Spin handles component configuration and application runtime values, then assess exposing component.build.workdir and the listed fields; done means applications can read the agreed values without component-specific paths and the behavior is tested.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.