Woo! Now all we need is a network to log in to run it on
Iām not quite sure, I have to look into it. I thought compiling with use-mock-routing
defaults to Alpha 1 although it wouldnāt recognize my login, I had to create new account.
@JPL Are you able to create new account?
Thanks so much for taking the time to compile this in an easy to install format for us non-tech maid followers!! Appreciate all of the hard work.
I was successfully able to download and started. I created a new account since I wasnāt able to log in with my previous credentials. For some reason when I tried the websites I had tried previously, I was not able to open it (e.g. safe://hello ). I may be doing something wrong, but appreciate all of the hard work!
This is good feedback for me. I need to search further into what my bundle is actually connecting to and how exactly itās listening for calls. Iāll update asap.
WHOOOOOOOOAH - i didnāt know how awesome those FFI bindings are Oo
i thought it would be more difficult to talk to Safenet via python but you can just use the cffi package and talk directly to the rust code
and current programs written in python can switch as easily to safe that way without the need of writing a special connection module ā¦ just using the built in C-API Oo
that is so supercool
Current progress on running safe_browser
with integrated beaker-plugin-safe-authenticator
:
safe_browser
is running and in my safe_app_nodejs
directory, Iām attempting to run the examples.
Iām running node ./examples/make_auth_request.js
(Iām running on Windows)
This simply opens file explorer.
Diving into the make_auth_request.js
,
createSAFEApp(appInfo).then(app =>
app.auth.genAuthUri(containers).then(res => {
console.log('trying to open request no ' + res.req_id + ' as ' + res.uri);
return lib.openUri(res.uri);
})
);
I follow lib.openUri(res.uri)
to an open
function in src/windows.rs
in the system_uri repo.
This function, as expected, is calling a command to open my file explorer.
Command::new("explorer").arg(uri)
The uri
argument is something like safe-auth:AAAAkK380jddk...==
Is file explorer taking that uri and trying to figure out what to do with it?
Iām looking into how to register a protocol, but Iām not quite sure if Iām looking in the right place because it seems to be more about telling Internet Explorer how to handle alternative protocols when I want to know how to register a protocol with file explorer:
Iām digging into this, trying to understand: Installing and Registering Protocol Handlers
Also this: Registering an Application to a URI Scheme
Am I on the right trail?
@hunterlester, looks like you are on the right track. I ll take this as an issue and test this on windows. Can you please confirm the system configuration you use?
The authenticator works with the mock routing feature. It is not possible to connect to any testnet. The safe_client_libs
dev
branch has the mock routing implementation for new data types. Vaults will have to integrate the new data types and at that point we can connect to the network.
Thank you, Krishna.
System info:
Windows 10 Home
Version: 1607
Build: 14393.693
Running everything in powershell, not WSL.
hmhmmm - okay - i have to admit it is not 100% as easy as hoped (iām too stupid to create suitable structs for rust - so i hard-coded the application details into the register function of the rust-safe-client
)
but for starters that isnāt too bad ā¦ =) at least i am using a function written in a different programming language (with one import and one āsingleā command after that)
iām very keen to see those ffi bindings in action!
Is there a way to test against the Authenticator as a standalone with out the beaker Browser? For an app that is not web based.
Yes.
There is a RUST API. There is example under safe-client.
or if you take a look at the safe-git. That is written in C++.
@anon81773980 Okay so no Rust coding is needed? And to be clear this is using Authenticator as a stand alone and not the launcher? Iāll look into this
From what Iām understanding, you can build authenticator through different programming languages other than rust. Maidsafe talked about FFI. Rust is in a unique place where any dynamic language can build with Rust. See here.
Again, there is a āemail CLI clientā which uses rust API authenticator as stand alone. it request the network, approves it, then you can send mail. (I might be wrong here, but based on what I read, it looks right)
https://github.com/maidsafe/safe_client_libs/blob/master/examples/email.rs#L36
@anon81773980 Yeah but is self auth using Authenticator? There is no Authenticator crate in maidsafes repo, only the beaker plugin. Which is why I ask if there is something stand alone from the Safe Browser as what is being developed will not be a web app
I was in same boat as you. I was completely confused on how it works. I done some studying, and found out there is a Authenticate crate. Safe_Core
Actually, they change the name to safe_client_libs
There āwasā a stand alone but it was kinda messy so it is moved to browser to reduce overlapping annoyance. Having switch to different window for every time one approves an app. See here.
See that (safecore)
? Thatās is calling from Rust safe_client_libs
Safe_launcher is GUI format.
safe_client_libs is CLI format.
Hereās another. It is drawing from this particular crate, safe_core
https://github.com/maidsafe/beaker-plugin-safe-authenticator/blob/master/src/ffi/ffi_loader.js#L32
As you see, safe_client_libs
is a powerhouse to call the network. So yes, there is Authenticator crate. You can draw it with any language as long you build a script that points to the safe_client_libs
There are three official Authenticator.
safe_client_libs
Safe-launcher
beaker-plugin-safe-authenticator (bpsa for ancroym)
There are two unofficial Authenticator
Safe-js
safe-git
If you want to build a stand alone client using Python, or Vulken to draw GUI for something like a multiplayer game. You need to build it yourself, and call it to safe_client_libs
The key here is in ffi
folder.
Hope that clarify your confusion.
@anon81773980 Thank you very much! This is good info
Thereās also an example simulate_browser.rs that compiled easily enough
but at least for this blind monkey, falls down at ln307
let unregistered_client = Arc::new(Mutex::new(unwrap!(Client::create_unregistered_client())));
I donāt know, if you might have more sense and better luck with itā¦ if it can work, it could be recrafted easily to something more useful than just an example?
https://github.com/maidsafe/safe_client_libs/blob/master/examples/simulate_browser.rs
Incidentally, the Cargo.toml to get that compiled I used:
[dependencies]
rustc-serialize = "0.3.18"
base64 = "0.2.1"
"url" = "0.5.9"
request = "0.0.8"
getopts = "*"
maidsafe_utilities = "~0.10.0"
safe_core = { git = "https://github.com/maidsafe/safe_client_libs" }
routing = { git = "https://github.com/maidsafe/routing" }
rust_sodium = "~0.1.2"
unwrap = "~1.1.0"
regex = "~0.1.77"
K I forgot to look in different branch other than master. I just found there is a more concrete system beneath. Waiting to be revealed.
https://github.com/maidsafe/safe_client_libs/tree/dev/safe_authenticator
Edited: Heh. I forgot to check safedev forums.