Closed adrianhopebailie closed 4 years ago
Why isn't this part of the application layer protocol? It seems like expiry might be important for some applications but not for others.
Currently Web Monetization never reuses STREAM credentials. Right now we expect them to always expire after one use, and you could set a cache control header to keep them around for longer
Why isn't this part of the application layer protocol? It seems like expiry might be important for some applications but not for others.
It is. But that means it needs to know that a connection can be closed and not re-opened at the transport layer.
Currently Web Monetization never reuses STREAM credentials. Right now we expect them to always expire after one use, and you could set a cache control header to keep them around for longer
But that assumption is not enforced at the transport protocol layer. If a client starts sending on a connection that the server considers closed what should happen?
@emschwartz @matdehaast @sappenin @sharafian any further feedback on this?
What is the correct behaviour of a STREAM receiver if it receives an incoming connection using old credentials?
What is the expected validity of credentials?
There is currently no way to explicitly "expire" a set of STREAM credentials
For security reasons, it seems best to treat Credentials Expired
and Invalid Credentials
as the same. In either case, the server shouldn't be using the credentials, so returning encrypted frames at all shouldn't be happening.
What is the correct behaviour of a STREAM receiver if it receives an incoming connection using old credentials?
Return an ILPv4 Reject
packet with an F06: Unexpected Payment
code and an optional error message. The credentials are no longer valid, so the server shouldn't be using them.
It seems like in order for this to be built into an application, you would need:
0x09 Application Error
seems like it would fit)What is the correct behaviour of a STREAM receiver if it receives an incoming connection using old credentials?
STREAM has no concept of credential expiry, so I wouldn't expect it to have any special behavior to handle this.
As discussed in other conversations about what should be in/out of STREAM, my general questions are:
The consensus from the ILP community call here is:
F06
error-code at the STREAM/ILPv4 layer is sufficient for this use-case (i.e., no need to explicitly add something new to STREAM itself).Also, we need to do some experiments to see how this could/should be added to the interface from the app layer down to the STREAM implementation.
Some ideas:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
If this issue is important, please feel free to bring it up on the next Interledger Community Group Call or in the Gitter chat.
There is currently no way to explicitly "expire" a set of STREAM credentials (the ILP Address and Shared Secret that the client uses to connect to the server).
This is a problem because technically they need to then be valid indefinitely which makes accounting for payments against specific connections difficult to do.
The simplest way to solve this seems to be simply adding an error code that the server can return to tell the client that the credentials have expired.
E.g.
0x0A
Connection Expired
If a client attempts to connect using expired credentials then the server can immediately respond with a
CloseConnection
frame and the new error code (0x0A
).The server may also send a
CloseConnection
frame and the new error code (0x0A
) at any time after a connection has been established.The expected behaviour is for the client to notify the calling application that the connection has expired and that it should perform setup again to get new credentials.
In the Web Monetization use case this would involve the sender making a new call to the Payment Pointer URL using the same
requestId
as before. This should return new credentials but the server should continue to associate incoming payments on the new connection with the samerequestId
.How a server tracks the expiry of credentials is left to the implementation. To do this across a distributed set of receivers it would likely be encoded into the address.