Remove callhome-server
[netconf.git] / apps / callhome-provider / src / main / java / org / opendaylight / netconf / callhome / server / ssh / CallHomeSshAuthProvider.java
diff --git a/apps/callhome-provider/src/main/java/org/opendaylight/netconf/callhome/server/ssh/CallHomeSshAuthProvider.java b/apps/callhome-provider/src/main/java/org/opendaylight/netconf/callhome/server/ssh/CallHomeSshAuthProvider.java
new file mode 100644 (file)
index 0000000..6d0fd78
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2023 PANTHEON.tech s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.netconf.callhome.server.ssh;
+
+import java.net.SocketAddress;
+import java.security.PublicKey;
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.Nullable;
+
+/**
+ * Provider responsible for resolving Call-Home SSH authorization.
+ */
+public interface CallHomeSshAuthProvider {
+    /**
+     * Provides auth parameters for incoming call-home connection.
+     *
+     * @param remoteAddress Remote socket address of incoming connection
+     * @param serverKey     SSH key provided by SSH server on incoming connection
+     * @return {@link CallHomeSshAuthSettings} instance if there are settings associated with incoming connection,
+     *     {@code null} otherwise.
+     */
+    @Nullable CallHomeSshAuthSettings provideAuth(@NonNull SocketAddress remoteAddress, @NonNull PublicKey serverKey);
+}