MCPcopy Create free account
hub / github.com/Preloading/TwitterAPIBridge / Token

Struct Token

db_controller/db_controller.go:51–63  ·  view source on GitHub ↗

I will most likely need to store auth tokens in a database, as I can only really get one auth related value from the user, and I can't change that value. I will probably send the oauth token as: {user did}/{generated uuid}/{encryptionkey} Since the only way to detect if a user has logged out is "/1/

Source from the content-addressed store, hash-verified

49
50// Token represents the schema for the tokens table
51type Token struct {
52 BasicAuthHash string `gorm:"type:string;"` // I am not a fan that i have to store this for basic authentication
53 BasicAuthUsername string `gorm:"type:string;index"` // Add this field with an index
54 UserDid string `gorm:"type:string;index;not null"`
55 UserPDS string `gorm:"type:string;not null"`
56 TokenUUID string `gorm:"type:string;primaryKey"`
57 EncryptedAccessToken string `gorm:"type:string;not null"`
58 EncryptedRefreshToken string `gorm:"type:string;not null"`
59 AccessExpiry float64 `gorm:"type:float;not null"`
60 RefreshExpiry float64 `gorm:"type:float;not null"`
61 BasicAuthSalt string `gorm:"type:string"`
62 TokenVersion int `gorm:"type:int;default:1"`
63}
64
65type TwitterIDs struct {
66 BlueskyID string `gorm:"type:string;not null"`

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected