-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2ceed25
commit c923508
Showing
13 changed files
with
120 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
mod list; | ||
mod create; | ||
mod delete; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
CREATE TABLE service_tokens ( | ||
id VARCHAR(64) NOT NULL, | ||
token_hash VARCHAR(64) NOT NULL, | ||
name VARCHAR(64) NOT NULL, | ||
created_by INT NOT NULL, | ||
created_at BIGINT NOT NULL, | ||
PRIMARY KEY (id), | ||
FOREIGN KEY (created_by) REFERENCES users(koala_id) | ||
); | ||
|
||
DROP TABLE service_token_user; | ||
|
||
ALTER TABLE chroma_scopes | ||
DROP CONSTRAINT chroma_scopes_pkey, | ||
ADD COLUMN service_token_id VARCHAR(64) DEFAULT NULL, | ||
DROP CONSTRAINT chroma_scopes_koala_id_fkey, | ||
ALTER COLUMN koala_id SET DEFAULT NULL, | ||
ADD COLUMN owner_type user_type NOT NULL, | ||
ADD PRIMARY KEY (koala_id, service_token_id, scope), | ||
ADD CONSTRAINT chroma_scopes_koala_id_fkey FOREIGN KEY (koala_id) REFERENCES users(koala_id), | ||
ADD CONSTRAINT chroma_scopes_service_token_id_fkey FOREIGN KEY (service_token_id) REFERENCES service_tokens(id); | ||
|
||
ALTER TABLE album_metadata RENAME created_by TO created_by_koala_id; | ||
ALTER TABLE album_metadata RENAME published_by TO published_by_koala_id; | ||
ALTER TABLE album_metadata | ||
ALTER COLUMN created_by_koala_id SET DEFAULT NULL, | ||
ALTER COLUMN published_by_koala_id SET DEFAULT NULL, | ||
ADD COLUMN created_by_service_token_id VARCHAR(64) DEFAULT NULL, | ||
ADD COLUMN published_by_service_token_id VARCHAR(64) DEFAULT NULL, | ||
ADD CONSTRAINT created_by_service_token_id_fkey FOREIGN KEY (created_by_service_token_id) REFERENCES service_tokens(id), | ||
ADD CONSTRAINT published_by_service_token_id_fkey FOREIGN KEY (published_by_service_token_id) REFERENCES service_tokens(id), | ||
ADD CONSTRAINT created_by_koala_id FOREIGN KEY (created_by_koala_id) REFERENCES users(koala_id), | ||
ADD CONSTRAINT published_by_koala_id FOREIGN KEY (published_by_koala_id) REFERENCES users(koala_id); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
syntax = "proto3"; | ||
package nl.svsticky.chroma; | ||
|
||
message CreateTokenRequest { | ||
string name = 1; | ||
repeated string scopes = 2; | ||
} | ||
|
||
message CreateTokenResponse { | ||
string id = 1; | ||
string name = 2; | ||
string token = 3; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
syntax = "proto3"; | ||
package nl.svsticky.chroma; | ||
|
||
message DeleteTokenRequest { | ||
string id = 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
syntax = "proto3"; | ||
package nl.svsticky.chroma; | ||
|
||
import "entity/user.proto"; | ||
|
||
message ListTokenResponse { | ||
repeated OpaqueToken tokens = 1; | ||
} | ||
|
||
message OpaqueToken { | ||
string id = 1; | ||
string name = 2; | ||
User createdBy = 3; | ||
int64 createdAt = 4; | ||
repeated string scopes = 5; | ||
} |