tangled
alpha
login
or
join now
mackuba.eu
/
blue_factory
1
fork
atom
A simple Ruby server using Sinatra that serves Bluesky custom feeds
1
fork
atom
overview
issues
pulls
pipelines
pass user context to the interactions handler
mackuba.eu
5 months ago
5cd474cf
567ce212
+5
-3
1 changed file
expand all
collapse all
unified
split
lib
blue_factory
server.rb
+5
-3
lib/blue_factory/server.rb
···
111
111
end
112
112
113
113
get '/xrpc/app.bsky.feed.describeFeedGenerator' do
114
114
-
return json_response({
114
114
+
json_response({
115
115
did: config.service_did,
116
116
feeds: config.feed_keys.map { |f| { uri: feed_uri(f) }}
117
117
})
118
118
end
119
119
120
120
get '/.well-known/did.json' do
121
121
-
return json_response({
121
121
+
json_response({
122
122
'@context': ['https://www.w3.org/ns/did/v1'],
123
123
id: config.service_did,
124
124
service: [
···
135
135
if config.interactions_handler
136
136
json = JSON.parse(request.body.read)
137
137
interactions = json['interactions'].map { |x| Interaction.new(x) }
138
138
-
config.interactions_handler.call(interactions)
138
138
+
context = RequestContext.new(request)
139
139
+
140
140
+
config.interactions_handler.call(interactions, context)
139
141
status 200
140
142
else
141
143
json_error('MethodNotImplemented', 'Method Not Implemented', status: 501)