This project has been archived by the C4DT Factory team. It is kept here for reference and for old URLs. You can find more information in our showcase and find our contact information.
This Swift package is an iOS library for REST requests using arti. This uses the code from lightarti-rest.
⚠️ Warning: lightarti-rest-ios is not secure in all situations Arti-android builds on top of [lightarti-rest]((https://github.com/c4dt/lightarti-rest), which modifies several core parts ofarti
. It therefore does not have the same security guarantees as arti or the stock Tor client would. Before integrating this library check the reliability considerations in the [lightarti-rest]((https://github.com/c4dt/lightarti-rest) repository to make sure that the security offered by this library is sufficient for your use case. In case of doubt, contact us in this repo. We'll be happy to discuss enhancements and limitations of our solution.
This version comes with a mandatory cache of the Tor directory data. This means that the app itself will have to download this data and make it available in a directory to the library.
For more information, see Directory Cache
There is a daily tor-directory update here: lightarti-directory
The lightarti-rest-ios
library exposes one call.
There is an example at lightarti-rest-ios-test that shows how
to use it.
/**
Makes a synchronous call to the arti library to fetch the given url with the indicated method.
The arti backend will
set up a new circuit over tor and send the request over this circuit.
In case of an error in the arti library, an ArtiError is thrown.
REST errors are returned through the 'status' field of the ReturnStruct.
- Parameters:
- method: one of the ARtiMethods
- url: the destination of the request
- headers: of the request
- body: data to be sent along
- Returns: a ReturnStruct with the result
- Throws: `ArtiError` in case something within the arti-library produced an error
*/
public func callArti(method: ArtiMethods, url: String,
headers: [String: [String]] = [:],
body: Data = Data([])) throws -> ReturnStruct
The ReturnStruct
has the following definition:
public struct ReturnStruct {
public var status: UInt16
public var headers: [String: [String]]
public var body: Data
}
Any REST-request error returns successfully, but the status
field will be set to an error-code.
To release a new version, please use the provided release.sh
script.
It takes no arguments and does the following:
- updates
Package.swift
with the latest xcframework from lightarti-rest - calculates the appropriate new tag
- at least the same version as lightarti-rest
- else increase the patch or release
- sets the tag
If run without arguments, it tests all the steps, without committing anything. Only if you run it like
./release.sh release
will it add the tag to the repo.
You'll have to do the git push --atomic origin main $NEWTAG
on your own.
lightarti-rest-ios
is maintained by the Center for Digital Trust. The following people contributed to the implementation of lightarti-rest
:
- Linus Gasser, C4DT
- Valérian Rousset, C4DT
- Christian Grigis, C4DT
- Laurent Girod, SPRING Lab, EPFL
Analysis and design by:
- Wouter Lueks, SPRING Lab, EPFL
- Carmela Troncoso, SPRING Lab, EPFL
External contributors:
- Benjamin Erhart, https://github.com/tladesignz