summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdoardo La Greca2025-09-02 21:23:48 +0200
committerEdoardo La Greca2025-09-02 21:23:48 +0200
commit8cf57c9ac359a4811b2b0aa5ebbc9c97817e0da1 (patch)
tree4a290959497e9871325c22f8e8e1a85e36901633
parentb02a4671baa8dc837b5a16bc9d61f82e85da911c (diff)
add documentation and missing parameter to auth
-rw-r--r--lib/src/main/kotlin/Connection.kt2
-rw-r--r--lib/src/main/kotlin/ProtocolTranslator.kt14
2 files changed, 14 insertions, 2 deletions
diff --git a/lib/src/main/kotlin/Connection.kt b/lib/src/main/kotlin/Connection.kt
index 871f5be..5557215 100644
--- a/lib/src/main/kotlin/Connection.kt
+++ b/lib/src/main/kotlin/Connection.kt
@@ -100,7 +100,7 @@ class Connection(transLay: TransportLayer) : ProtocolTranslator {
}
}
- override fun auth(afid: UInt, uname: String, aname: String) {
+ override fun auth(afid: UInt, uname: String, aname: String, auther: Authenticator) {
// TODO: Leave this unimplemented until p9any and TLS are implemented
}
diff --git a/lib/src/main/kotlin/ProtocolTranslator.kt b/lib/src/main/kotlin/ProtocolTranslator.kt
index 4b3b91a..86564a5 100644
--- a/lib/src/main/kotlin/ProtocolTranslator.kt
+++ b/lib/src/main/kotlin/ProtocolTranslator.kt
@@ -32,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.