Skip to content

Commit

Permalink
ODIS V1 Sunset (#10444)
Browse files Browse the repository at this point in the history
* removed legacy code

* ∆ PnpSignAction and PnpQuotaService
to non-abstract class

* renamed variable

* removed empty test

* lowered coverage threshold by 3%

* add back legacy accounts table for now (#10450)

* update sdk/identity

* deprecate `endpoint` variable

* removed todo comment

* removed commented var

* increased fetch_depth

* increase all fetch_depth

* ∆ `pull_request_target` to `pull_request`

* bump version

* remove endpoint var from call to ODIS

* decreased code coverage to threshold to 76%

---------

Co-authored-by: Alec Schaefer <[email protected]>
  • Loading branch information
soloseng and alecps authored Aug 2, 2023
1 parent 21cdce6 commit 6b3decd
Show file tree
Hide file tree
Showing 41 changed files with 68 additions and 4,514 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/circleci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -460,9 +460,9 @@ jobs:
package-json-checksum: ${{ needs.install-dependencies.outputs.package-json-checksum }}
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v35
uses: tj-actions/changed-files@v37
with:
fetch_depth: '100'
fetch_depth: '150'
- name: Generate DevChain
run: |
cd packages/sdk/identity
Expand Down
3 changes: 1 addition & 2 deletions packages/phone-number-privacy/combiner/src/common/sign.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {
DomainRestrictedSignatureRequest,
ErrorMessage,
ErrorType,
LegacySignMessageRequest,
OdisResponse,
responseHasExpectedKeyVersion,
SignMessageRequest,
Expand All @@ -18,8 +17,8 @@ import { IO } from './io'
// prettier-ignore
export type OdisSignatureRequest =
| SignMessageRequest
| LegacySignMessageRequest
| DomainRestrictedSignatureRequest

export type ThresholdStateService<R extends OdisSignatureRequest> = R extends SignMessageRequest
? PnpThresholdStateService<R>
: never | R extends DomainRestrictedSignatureRequest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
ErrorType,
getSignerEndpoint,
hasValidAccountParam,
identifierIsValidIfExists,
isBodyReasonablySized,
PnpQuotaRequest,
PnpQuotaRequestSchema,
Expand Down Expand Up @@ -57,7 +56,6 @@ export class PnpQuotaIO extends IO<PnpQuotaRequest> {
return (
super.validateClientRequest(request) &&
hasValidAccountParam(request.body) &&
identifierIsValidIfExists(request.body) &&
isBodyReasonablySized(request.body)
)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {
ErrorMessage,
ErrorType,
LegacySignMessageRequest,
SignMessageRequest,
WarningMessage,
} from '@celo/phone-number-privacy-common'
Expand All @@ -12,7 +11,7 @@ import { PnpSignerResponseLogger } from '../../services/log-responses'
export class PnpSignAction extends SignAction<SignMessageRequest> {
readonly responseLogger: PnpSignerResponseLogger = new PnpSignerResponseLogger()

combine(session: CryptoSession<SignMessageRequest | LegacySignMessageRequest>): void {
combine(session: CryptoSession<SignMessageRequest>): void {
this.responseLogger.logResponseDiscrepancies(session)
this.responseLogger.logFailOpenResponses(session)

Expand Down Expand Up @@ -41,7 +40,7 @@ export class PnpSignAction extends SignAction<SignMessageRequest> {
this.handleMissingSignatures(session)
}

protected parseBlindedMessage(req: SignMessageRequest | LegacySignMessageRequest): string {
protected parseBlindedMessage(req: SignMessageRequest): string {
return req.blindedQueryPhoneNumber
}

Expand Down

This file was deleted.

18 changes: 0 additions & 18 deletions packages/phone-number-privacy/combiner/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import { PnpQuotaAction } from './pnp/endpoints/quota/action'
import { PnpQuotaIO } from './pnp/endpoints/quota/io'
import { PnpSignAction } from './pnp/endpoints/sign/action'
import { PnpSignIO } from './pnp/endpoints/sign/io'
import { LegacyPnpSignIO } from './pnp/endpoints/sign/io.legacy'
import { PnpThresholdStateService } from './pnp/services/threshold-state'

require('events').EventEmitter.defaultMaxListeners = 15
Expand Down Expand Up @@ -61,23 +60,6 @@ export function startCombiner(config: CombinerConfig, kit: ContractKit) {

const pnpThresholdStateService = new PnpThresholdStateService()

const legacyPnpSign = new Controller(
new PnpSignAction(
config.phoneNumberPrivacy,
pnpThresholdStateService,
new LegacyPnpSignIO(config.phoneNumberPrivacy, kit)
)
)
app.post(CombinerEndpoint.LEGACY_PNP_SIGN, (req, res) =>
meterResponse(
legacyPnpSign.handle.bind(legacyPnpSign),
req,
res,
CombinerEndpoint.LEGACY_PNP_SIGN,
config
)
)

const pnpQuota = new Controller(
new PnpQuotaAction(
config.phoneNumberPrivacy,
Expand Down
Loading

0 comments on commit 6b3decd

Please sign in to comment.