mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 18:18:55 +00:00
Initially, we thought that we need to replace the entire `Allocation` if the credentials to the relay change. However, during testing it turned out that the credentials will change every time the portal sends us new credentials. Likely, the portal hashes some kind of nonce into the password as well. Consequently, throwing away the entire state of the `Allocation` is wrong. Instead, we will simply try to refresh the allocation using the new credentials. If the refresh fails, we will try to make a new allocation. If that also fails unrecoverably, then we "suspend" the allocation, i.e. the `Allocation` will not perform any further action by itself. In case we get a new `refresh` call (which happens every time we want to use the `Allocation` for a connection), we restart things and try to make a new one.