)]}'
{"keystone/models/token_model.py":[{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"bcdc36b7048a81d28147ec727f05b7ba146598b7","unresolved":false,"context_lines":[{"line_number":566,"context_line":"        self.issued_at \u003d issued_at"},{"line_number":567,"context_line":""},{"line_number":568,"context_line":"    @property"},{"line_number":569,"context_line":"    def payload_class(self):"},{"line_number":570,"context_line":"        if self.oauth_scoped:"},{"line_number":571,"context_line":"            return token_formatters.OauthScopedPayload"},{"line_number":572,"context_line":"        elif self.trust_scoped:"}],"source_content_type":"text/x-python","patch_set":3,"id":"ffd0ebdf_c9ed6726","line":569,"updated":"2019-01-03 20:36:34.000000000","message":"I like how this removes the need to enforce a specific ordering, nice work! But, I\u0027m not sure if it should be a property of the token model.\n\nIn my opinion, a payload class is actually an implementation detail of how the fernet token provider encapsulates payload structures for different token types. In that case, I wonder if this piece wouldn\u0027t be a better fit in the fernet token provider and not the token formatter.\n\nAlso, do we expect other token providers to reuse these exact payload classes? Originally, we thought we might be able to reuse this for JWT support, but with how JWT works I don\u0027t think a serialized payload is necessary (JWT can accomplish this with key-value pairs at the expense of a larger token ID).","commit_id":"5c2241c3edab388fb87653b4b579ec97f22e9d28"},{"author":{"_account_id":15054,"name":"wangxiyuan","email":"wangxiyuan1007@gmail.com","username":"wangxiyuan"},"change_message_id":"4ab553b5950e6a8836417d0f562c88a9268694a8","unresolved":false,"context_lines":[{"line_number":566,"context_line":"        self.issued_at \u003d issued_at"},{"line_number":567,"context_line":""},{"line_number":568,"context_line":"    @property"},{"line_number":569,"context_line":"    def payload_class(self):"},{"line_number":570,"context_line":"        if self.oauth_scoped:"},{"line_number":571,"context_line":"            return token_formatters.OauthScopedPayload"},{"line_number":572,"context_line":"        elif self.trust_scoped:"}],"source_content_type":"text/x-python","patch_set":3,"id":"dfd5e7cf_985f8240","line":569,"in_reply_to":"ffd0ebdf_c9ed6726","updated":"2019-01-09 06:27:53.000000000","message":"Done","commit_id":"5c2241c3edab388fb87653b4b579ec97f22e9d28"}],"keystone/token/providers/fernet/core.py":[{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"bcdc36b7048a81d28147ec727f05b7ba146598b7","unresolved":false,"context_lines":[{"line_number":49,"context_line":"            token.user_id,"},{"line_number":50,"context_line":"            token.expires_at,"},{"line_number":51,"context_line":"            token.audit_ids,"},{"line_number":52,"context_line":"            token.payload_class,"},{"line_number":53,"context_line":"            methods\u003dtoken.methods,"},{"line_number":54,"context_line":"            system\u003dtoken.system,"},{"line_number":55,"context_line":"            domain_id\u003dtoken.domain_id,"}],"source_content_type":"text/x-python","patch_set":3,"id":"ffd0ebdf_e9014bb1","line":52,"range":{"start_line":52,"start_character":18,"end_line":52,"end_character":31},"updated":"2019-01-03 20:36:34.000000000","message":"I think we can remove this if we take the following approach:\n\n\n  def _determine_payload_class_from_token(self, token):\n      if token.oauth_scoped:\n          return self.token_formatters.OauthScopedPayload\n      elif token.trust_scoped:\n          return self.token_formatters.TrustScopedPayload\n      elif token.is_federated:\n          if token.project_scoped:\n              return self.token_formatters.FederatedProjectScopedPayload\n          elif token.domain_scoped:\n              return self.token_formatters.FederatedDomainScopedPayload\n          elif token.unscoped:\n              return self.token_formatters.FederatedUnscopedPayload\n      elif token.application_credential_id:\n          return self.token_formatters.ApplicationCredentialScopedPayload\n      elif token.project_scoped:\n          return self.token_formatters.ProjectScopedPayload\n      elif token.domain_scoped:\n          return self.token_formatters.DomainScopedPayload\n      elif token.system_scoped:\n          return self.token_formatters.SystemScopedPayload\n      else:\n          return self.token_formatters.UnscopedPayload\n\n  def generate_id_and_issued_at(self, token):\n      payload_class \u003d self._determine_payload_class_from_token(token)\n\nWhich has the advantage of keeping payload details specific to fernet out of the token model. Also, it keeps the token model from having a dependency on the token_formatter module, since we have that available as a property of the Provider instance here.","commit_id":"5c2241c3edab388fb87653b4b579ec97f22e9d28"},{"author":{"_account_id":15054,"name":"wangxiyuan","email":"wangxiyuan1007@gmail.com","username":"wangxiyuan"},"change_message_id":"4ab553b5950e6a8836417d0f562c88a9268694a8","unresolved":false,"context_lines":[{"line_number":49,"context_line":"            token.user_id,"},{"line_number":50,"context_line":"            token.expires_at,"},{"line_number":51,"context_line":"            token.audit_ids,"},{"line_number":52,"context_line":"            token.payload_class,"},{"line_number":53,"context_line":"            methods\u003dtoken.methods,"},{"line_number":54,"context_line":"            system\u003dtoken.system,"},{"line_number":55,"context_line":"            domain_id\u003dtoken.domain_id,"}],"source_content_type":"text/x-python","patch_set":3,"id":"dfd5e7cf_184cf29c","line":52,"range":{"start_line":52,"start_character":18,"end_line":52,"end_character":31},"in_reply_to":"ffd0ebdf_e9014bb1","updated":"2019-01-09 06:27:53.000000000","message":"Done","commit_id":"5c2241c3edab388fb87653b4b579ec97f22e9d28"}]}
