summaryrefslogtreecommitdiff
path: root/lib/src/main/kotlin/ProtocolTranslator.kt
diff options
context:
space:
mode:
Diffstat (limited to 'lib/src/main/kotlin/ProtocolTranslator.kt')
-rw-r--r--lib/src/main/kotlin/ProtocolTranslator.kt18
1 files changed, 16 insertions, 2 deletions
diff --git a/lib/src/main/kotlin/ProtocolTranslator.kt b/lib/src/main/kotlin/ProtocolTranslator.kt
index 8af0aea..24c4f90 100644
--- a/lib/src/main/kotlin/ProtocolTranslator.kt
+++ b/lib/src/main/kotlin/ProtocolTranslator.kt
@@ -1,3 +1,5 @@
+// TODO: Add asynchronous message handling (as of now, the flush method is useless)
+
/**
* The [ProtocolTranslator] interface provides methods which represent, and enclose, full 9P transactions. A call to any
* of such methods requires filling in parameters, which coincide one-to-one with fields required by 9P requests. In an
@@ -19,7 +21,7 @@ interface ProtocolTranslator {
* been received.
*
* @param msize The maximum length, in bytes, that the client will ever generate or expect to receive in a single
- * 9P message.
+ * 9P message.
* @param version Should be "9P2000", which is the only defined value.
* @throws except.InvalidMessageException if the received message is invalid.
* @throws except.RErrorException if the received message is an R-error message.
@@ -30,8 +32,20 @@ interface ProtocolTranslator {
/**
* Perform authentication.
+ *
+ * 9P itself neither defines a user authentication protocol in its specification, nor requires the usage of a
+ * specific existing one. However, it provides a way of running an authentication protocol of choice on top of
+ * itself, as long as both the client and the server agree on one. Right after the server's `R-auth` message, using
+ * 9P's `read` and `write` messages on the authentication FID, it is possible to exchange authentication messages.
+ * This [auth] method performs both the 9P `auth` transaction and the successive authentication protocol.
+ *
+ * @param afid A new FID for authentication.
+ * @param uname The user identifier.
+ * @param aname The file tree to access.
+ * @param auther The [Authenticator] instance that provides one or more authentication protocols. This parameter is
+ * NineKt-specific and does not appear in the protocol specification.
*/
- fun auth(afid: UInt, uname: String, aname: String)
+ fun auth(afid: UInt, uname: String, aname: String, auther: Authenticator)
/**
* Abort a message.