-
-
Notifications
You must be signed in to change notification settings - Fork 46
/
auth.ex
28 lines (21 loc) · 779 Bytes
/
auth.ex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
defmodule K8s.Conn.Auth do
@moduledoc """
Authorization behaviour
"""
@doc """
Creates a struct holding the information to authenticate against the
API server.
### Arguments
* `auth_map` - A map representing the `.users[].user` part from a kubeconfig.
* `base_path` - The path to the folder holding the kubeconfig file.
### Result
The struct returned by this function MUST implement the
`K8s.Conn.RequestOptions` protocol.
Return `:skip` to signal to `K8s.Conn` to skip a provider that would not
authenticate the current connection.
### Examples
See the various modules implementing this behaviour for examples.
"""
@callback create(auth_map :: map(), base_path :: String.t()) ::
{:ok, struct} | {:error, any} | :skip
end